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
| /* eslint-disable no-console */ | |
| const https = require('https'); | |
| const fetch = require('node-fetch'); | |
| const ntlm = require('httpntlm').ntlm; | |
| const keepAlive = new https.Agent({ keepAlive: true }); | |
| const handleErrors = (response) => { | |
| if (!response.ok) { |
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
| var startedAt = (new Date).toString(); | |
| var lastExecuted = null; | |
| exports.ping = function(event, context, done) { | |
| lastExecutedCopy = lastExecuted; | |
| lastExecuted = (new Date).toString(); | |
| done(null, { | |
| warm: !!lastExecutedCopy, | |
| startedAt: startedAt, | |
| last: lastExecutedCopy, |
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
| // Type Definitions | |
| type UserListing = { | |
| users: Array<User> | |
| } | |
| type ProfilePic = { | |
| url: string, | |
| width: number, | |
| height: number |
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
| import {SuitType} from "./types"; | |
| import {generateSchema} from "flow-runtime"; | |
| const validate = (value, type) => { | |
| return joi.validate(value, generateSchema(type), { | |
| abortEarly: false | |
| }); | |
| } | |
| // Validation calls |
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
| type Suit = | |
| | "Diamonds" | |
| | "Clubs" | |
| | "Hearts" | |
| | "Spades"; | |
| // Babel transformed into Flow AST: | |
| export const SuitType = { | |
| type: 'UnionTypeAnnotation', |
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
| import {map, unique, sort} from "prelude-ls" | |
| types | |
| ::map(v => v[type]) | |
| ::unique | |
| ::sort | |
| ::map(toOption); |
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
| import {map, unique} from "prelude-ls"; | |
| function pipe(input, ...funcs) { | |
| return funcs.reduce((step, f) => f(step), input); | |
| } | |
| function curry(fn, ...args) { | |
| if (args.length >= fn.length) { | |
| return fn(...args); | |
| } |
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
| source "https://rubygems.org" | |
| gem 'rspec' | |
| gem 'capybara' | |
| gem 'poltergeist' | |
| gem 'selenium-webdriver' |
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
| require 'librato/metrics' | |
| REPO_NAME = 'JoeStanton/my-project' | |
| Librato::Metrics.authenticate '[email protected]', 'API_KEY' | |
| sha, msg = `git log -n 1 --pretty="%h:%s"`.strip.split(":", 2) | |
| Librato::Metrics.annotate :deployments, "Deployed #{sha}", { | |
| description: msg, | |
| links: [ {rel: "github", href: "http://github.com/#{REPO_NAME}/commit/#{sha}"} ] | |
| } |
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
| StatsD.increment 'user.signups' | |
| StatsD.measure 'user synchronization' do | |
| Users.sync() | |
| end |
NewerOlder