This file contains 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 foo = require('foo') | |
foo.bar(foo => { baz: 'qux' }) |
This file contains 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 express = require('express') | |
const jwt = require('express-jwt') | |
const permissions = require('express-jwt-permissions')() | |
const unless = require('express-unless') | |
const app = express() | |
const checkAuth = jwt({ secret: process.env.JWTSECRET }) | |
const checkAdmin = permissions.check(['admin']) | |
checkAdmin.unless = unless |
This file contains 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 fs = require('fs') | |
const pify = require('pify') | |
const readFile = pify(fs.readFile) | |
async function main () { | |
const results = [ | |
await readFile('foo.txt'), | |
await readFile('bar.txt') | |
].join('\n') |
This file contains 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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func pinger(channel chan<- string) { | |
for { | |
channel <- "ping" |
This file contains 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
atom-alignment | |
atom-ternjs | |
docblockr | |
emmet | |
file-icons | |
highlight-selected | |
hyperclick | |
js-hyperclick | |
linter | |
linter-js-standard |
This file contains 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
pipeline: | |
... | |
deploy: | |
image: google/cloud-sdk | |
commands: | |
- printenv KUBE_SERVICE_ACCOUNT > credentials.json | |
- gcloud auth activate-service-account --key-file=credentials.json | |
- "gcloud container clusters get-credentials $CLUSTER_NAME \ | |
--zone $PROJECT_ZONE \ | |
--project $PROJECT_NAME" |
This file contains 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
// Module to talk to the SHT21 temperature and humidity sensor over I2C | |
var i2c = require('i2c'); | |
// Register addresses | |
const TRIGGER_T_MEASUREMENT_NO_HOLD = 0xF3; | |
const TRIGGER_RH_MEASUREMENT_NO_HOLD = 0xF5; | |
const WRITE_USER_REGISTER = 0xE6; | |
const READ_USER_REGISTER = 0xE7; | |
const SOFT_RESET = 0xFE; |
This file contains 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
'use strict' | |
const AMOUNT = 300000 | |
const YEARS = 25 | |
const RATE = 2.19 | |
const MONTHS = yearsToMonths(YEARS) | |
const MONTHLY = monthly(AMOUNT, YEARS, RATE) | |
// generate an array with shorted name of each month |
This file contains 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 app = require('./app') | |
const request = require('supertest') | |
test('get a user', async () => { | |
const response = await request(app) | |
.get('/users/1') | |
expect(response.status).toBe(200) | |
expect(response).toMatchSnapshot() | |
}) |
This file contains 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
exports[`get a user 1`] = `{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"properties": { | |
"created_at": { | |
"type": "string" | |
}, | |
"email": { | |
"type": "string" | |
}, | |
"first_name": { |