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
#!/bin/bash | |
# Installs a dependency from a git repo using info specified in pakage.json, then builds it | |
: <<"MultilineCommentDelimiter" | |
Place this file in ./devops/git-dependency/install-and-build.sh | |
Update package.json to add "config" and a a build step to "scripts" | |
{ | |
"config": { |
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
// returns a promise that always rejects | |
function myPromise() { | |
return new Promise((resolve, reject) => { | |
reject('error in myPromise'); | |
}); | |
} | |
// promise.catch(a).then(b).catch(c) | |
myPromise().catch(function a(err) { | |
console.log('a:', err); |
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 co = require('co'); | |
const chai = require('chai'); | |
const expect = chai.expect; | |
describe.only('[Braintree SDK]', function() { | |
this.timeout(5000); |
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
Array.from(document.querySelectorAll('a')) | |
.filter((a) => { return !a.href.match( /^https?\:\/\/example\.com\// ); }) | |
.map((a) => (`- [${a.text}](${a.href})`)) | |
.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
'use strict'; | |
let co = require('co'); | |
let chai = require('chai'); | |
let expect = chai.expect; | |
function waitFor(duration) { | |
return new Promise(function(resolve) { | |
setTimeout(resolve, duration); | |
}); |
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
$ letsencrypt-auto --help all | |
Updating letsencrypt and virtual environment dependencies....... | |
usage: | |
letsencrypt [SUBCOMMAND] [options] [-d domain] [-d domain] ... | |
The Let's Encrypt agent can obtain and install HTTPS/TLS/SSL certificates. By | |
default, it will attempt to use a webserver both for obtaining and installing | |
the cert. Major SUBCOMMANDS are: | |
(default) run Obtain & install a cert in your current webserver |
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
/* jshint node: true */ | |
'use strict'; | |
var gulp = require('gulp'), | |
bower = require('./bower'), | |
replace = require('gulp-replace'), | |
through2 = require('through2'); | |
/** |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/* | |
* Places the `k` smallest elements (by `propName`) in `arr` in the first `k` indices: `[0..k-1]` | |
* Modifies the passed in array *in place* | |
* Returns a slice of the wanted eleemnts for convencience | |
* Efficent mainly due to never performaing a full sort. | |
* | |
* The only guarantees are that: | |
* | |
* - The `k`th element is in its final sort index, if the array were to be sorted | |
* - All elements before index `k` are smaller than the `k`th element |