This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "title": "Takeout API", | |
| "discoveryVersion": "v1", | |
| "ownerName": "Google", | |
| "version_module": true, | |
| "resources": { | |
| "exports": { | |
| "methods": { | |
| "get": { | |
| "flatPath": "v2/{service}/exports/{exportId}", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { ApolloServer } = require("apollo-server"); | |
| const gql = require("graphql-tag"); | |
| const fetch = require("node-fetch"); | |
| const { | |
| introspectionQuery, | |
| buildClientSchema, | |
| printSchema | |
| } = require("graphql"); | |
| const typeDefs = gql` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| var video = document.querySelector('video:not([title="Advertisement"])') | |
| if (!video.webkitSupportsPresentationMode || typeof video.webkitSetPresentationMode !== 'function') { | |
| console.error('Esse código só funciona no Safari!') | |
| return | |
| } | |
| var scoreX = document.querySelector('.placar__equipes') | |
| var button = document.createElement('button') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const all = (...preds) => (obj) => preds.map(f => f(obj)).reduce((a, b) => a && b, true) | |
| const any = (...preds) => (obj) => preds.map(f => f(obj)).reduce((a, b) => a || b, false) | |
| const oneOf = (...preds) => (obj) => preds.map(f => f(obj)).reduce((a, b) => a ? !b : b, false) | |
| const has = (prop) => (obj) => obj[prop] !== undefined | |
| const not = (pred) => (obj) => !pred(obj) | |
| const equals = (prop, val) => (obj) => obj[prop] === val | |
| const implies = (f, g) => (obj) => !f(obj) || g(obj); | |
| const validate = all(implies(has('selectedIndex'), equals('isOpen', true))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| machine: | |
| node: | |
| version: 6.9.5 | |
| dependencies: | |
| pre: | |
| - 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc' | |
| test: | |
| override: | |
| - rm -rf $CIRCLE_ARTIFACTS/coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const wait = ( | |
| time, | |
| cancel = Promise.reject() | |
| ) => new Promise((resolve, reject) => { | |
| const timer = setTimeout(resolve, time); | |
| const noop = () => {}; | |
| cancel.then(() => { | |
| clearTimeout(timer); | |
| reject(new Error('Cancelled')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Currying Functions with Named Parameters. | |
| * @gunar, @drboolean, @dtipson 2016 | |
| * | |
| * Why does it return a thunk, though? | |
| * Because in JS named arguments are opaque. There is no way of getting a function's named arguments list. | |
| * e.g. | |
| * const foo = function ({ a, b }) { } | |
| * console.log(foo.arguments) // Throws. Ideally would return ['a', 'b']. | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class RowNotFound extends Error { | |
| constructor() { | |
| const message = `Row not found`; | |
| super(message); | |
| this.message = message; | |
| this.name = 'RowNotFound'; | |
| } | |
| } | |
| function checkRowExists(row) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Changed to use content-type flag instead of header: -H 'Content-Type: application/json' | |
| siege -c50 -t60S --content-type "application/json" 'http://domain.com/path/to/json.php POST {"ids": ["1","2","3"]}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| awful.key({ }, "XF86AudioPlay", function () awful.util.spawn_with_shell("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause") end), | |
| awful.key({ }, "XF86AudioNext", function () awful.util.spawn_with_shell("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next") end), | |
| awful.key({ }, "XF86AudioPrev", function () awful.util.spawn_with_shell("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous") end) |
NewerOlder