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 e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
var Linter = require('./linter'); | |
var cheerio = require('cheerio'); | |
function HtmlPage(html) { | |
this.dom = cheerio.load(html); | |
} | |
HtmlPage.prototype.all = function(selector) { | |
return this.dom(selector); |
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 plastiq = require('plastiq'); |
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
alert('hello'); |
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 moment = require('moment'); | |
document.body.innerHTML = moment('5th Jan 2018', 'Do MMM YYYY'); |
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 QuickGlanceFormatter < ActiveSupport::Logger::SimpleFormatter | |
def call(severity, timestamp, progname, message) | |
m = message + "\n" | |
if m =~ /^Started ([A-Z]+) (.+)/m | |
"\033[34m\n#{$1} #{$2}\033[0m" | |
elsif m =~ /^Processing by (.+)/m | |
"\033[34m↳ #{$1}\033[0m" | |
elsif m =~ /^Completed (\d\d\d) (.+)/m | |
status = $1 | |
rest = $2 |
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
echo | |
echo "DELETE INDEX" | |
echo | |
curl -w "\r\n" -X DELETE http://localhost:9200/temp-index | |
echo | |
echo "CREATE MAPPINGS" | |
echo | |
curl -w "\r\n" -X POST http://localhost:9200/temp-index -d '{"mappings":{"asset":{"properties":{"name":{"type":"string","analyzer":"snowball"},"description":{"type":"string","analyzer":"snowball"}}}},"settings":{}}' |
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 browserMonkey = require('browser-monkey'); | |
var builder = require('promise-builder'); | |
function append(html) { document.body.innerHTML += '<p>' + html + '</p>'; } | |
append('<div id="x"><button id="A">A</button></div>'); | |
append('<div id="y"><button id="B">B</button></div>'); | |
append('<div id="z"><button id="C">C</button></div>'); | |
function apiForScope(scope) { |
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 plastiq = require('plastiq'); | |
var h = plastiq.html; | |
function render(model) { | |
return h('form', | |
renderFieldWithPlaceholder('First name', [model, 'firstName']), | |
renderFieldWithPlaceholder('Last name', [model, 'lastName']), | |
h('pre', JSON.stringify(model)) | |
); | |
} |
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
/* | |
# stateful-promise | |
Encapsulates a repeatable asynchronous operation, and exposes the state of the | |
current invocation. | |
``` | |
model.documents = new StatefulPromise(() => | |
http.get('/documents').then(response => response.body); | |
); |
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
window.grecaptcha = { | |
getResponse: function() { | |
return 'FAKE-RECAPTCHA-RESPONSE' | |
}, | |
reset: function() { | |
console.log("FAKE-RECAPTCHA-RESET", arguments) | |
}, | |
render: function() { |