View .js
const get = require('lodash.get')
const vars = { first: 'spencer', last: 'alger', age: 28 }
return 'Mr. { first } {last }, age {age}'.replace(/\{\s*(.+?)\s*\}/g, (_, name) => get(vars, name))
View eswait.js
(function checkForConnection() {
esClient.ping(function (err, pong) {
if (pong) {
console.log("Ping got pong!");
} else {
console.log("Ping did not get pong, trying again in 3sec.");
setTimeout(checkForConnection, 3000);
}
})
}());
View partial.js
var partial = (function () {
'use strict';
const caches = new WeakMap()
return function partial(fn, ...args) {
let toApply = fn
while (args.length) {
if (!caches.has(toApply)) caches.set(toApply, [])
View loader.js
/*
* SystemJS v0.19.17
*/
!function(){function e(){!function(e){function t(e,t){var n;return e instanceof Error?(n=new Error(e.message,e.fileName,e.lineNumber),M?(n.message=e.message+"\n "+t,n.stack=e.stack):(n.message=e.message,n.stack=e.stack+"\n "+t)):n=e+"\n "+t,n}function n(e,n,r){try{new Function(e).call(r)}catch(a){throw t(a,"Evaluating "+n)}}function r(){}function a(t){this._loader={loaderObj:this,loads:[],modules:{},importPromises:{},moduleRecords:{}},z(this,"global",{get:function(){return e}})}function o(){a.call(this),this.paths={}}function s(e,t){var n,r="",a=0;for(var o in e){var s=o.split("*");if(s.length>2)throw new TypeError("Only one wildcard in a path is permitted");if(1==s.length){if(t==o)return e[o];if(t.substr(0,o.length-1)==o.substr(0,o.length-1)&&(t.length<o.length||t[o.length-1]==o[o.length-1])&&"/"==e[o][e[o].length-1])return e[o].substr(0,e[o].length-1)+(t.length>o.length?"/"+t.substr(o.length):"")}else{var i=s[0].length;i>=a&&t.substr(0,s[0].length)==s[0]&&t.substr(t.length-s[1].l
View gulpfile.babel.js
import gulp from 'gulp'
import babel from 'gulp-babel'
import combiner from 'stream-combiner2'
import sourcemaps from 'gulp-sourcemaps'
import watch from 'gulp-watch'
import gulpif from 'gulp-if'
import del from 'del'
import vinylPaths from 'vinyl-paths'
gulp.task('default', function () {
View git-cherry-pick-pr.sh
#!/usr/bin/env bash
# call this with the pr number you want to apply and the base branch of that pr
#
# backport pr 5805, which was submitted against master, to 4.4:
# git co 4.4
# git cherry-pick-pr 5805
#
# backport pr 5840, which was submitted against 4.x, to 4.4:
# git co 4.4
View patch_sonarr.sh
#!/usr/bin/env bash
set -e
cd ~/apps/NzbDrone/UI;
all="handlebars.combined.js"
runtime="handlebars.runtime.js"
tmpl="templates.js"
#####
View index.js
const url = require('url');
const rison = require('rison');
window.parseRison = function () {
var output = document.getElementById('risonOutput');
var input = document.getElementById('risonInput').value;
var j = function (v) {
return JSON.stringify(v, null, ' ');
};