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 readline = require('readline'); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
terminal: false | |
}); | |
const lines = []; |
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
class LinkedList { | |
constructor(value) { | |
this.value = value; | |
this.next = null; | |
} | |
push(value) { | |
let end = this; | |
while (end.next) { | |
end = end.next; |
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 puppeteer = require('puppeteer'); // v 1.1.0 | |
const { URL } = require('url'); | |
const fse = require('fs-extra'); // v 5.0.0 | |
const path = require('path'); | |
const NO_RESPONSE_ERROR_MESSAGE = 'No data found for resource with given identifier'; | |
const NAME_TOO_LONG_ERROR_MESSAGE = 'ENAMETOOLONG'; | |
const THIRTY_SECONDS_MS = 1000 * 30; | |
const visited = new Set(); |
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 https = require('https'); | |
function postToSlack(body) { | |
return new Promise(function(ok, fail) { | |
var jsonObject = JSON.stringify(body); | |
// the post options | |
var optionspost = { | |
host: 'hooks.slack.com', | |
port: 443, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" | |
integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" | |
crossorigin=""/> |
This file has been truncated, but you can view the full file.
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
[{"geoid":1,"type":"state","name":"Alabama","long":-86.8283671,"lat":32.7898261,"box":[-88.473227,30.223334,-84.88908,35.008028]},{"geoid":4,"type":"state","name":"Arizona","long":-111.6644073,"lat":34.2931046,"box":[-114.81651,31.332177,-109.045223,37.00426]},{"geoid":5,"type":"state","name":"Arkansas","long":-92.4392611,"lat":34.899739,"box":[-94.617919,33.004106,-89.644395,36.4996]},{"geoid":6,"type":"state","name":"California","long":-119.6106862,"lat":37.2460656,"box":[-124.409591,32.534156,-114.131211,42.009518]},{"geoid":"","type":"state","name":"Colorado","long":-105.5478146,"lat":38.9985455,"box":[-109.060253,36.992426,-102.041524,41.003444]},{"geoid":8,"type":"state","name":"Connecticut","long":-72.725705,"lat":41.6202779,"box":[-73.727775,40.980144,-71.786994,42.050587]},{"geoid":9,"type":"state","name":"Delaware","long":-75.5004023,"lat":38.9870086,"box":[-75.788658,38.451013,-75.048939,39.839007]},{"geoid":10,"type":"state","name":"Georgia","long":-83.446338,"lat":32.6492228,"box":[-85.605165,30. |
This file has been truncated, but you can view the full file.
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
[ | |
{ | |
"geoid": 1, | |
"type": "state", | |
"name": "Alabama", | |
"box": [ | |
-88.473227, | |
30.223334, | |
-84.88908, | |
35.008028 |
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 graphqlHTTP = require('express-graphql'); | |
const { makeExecutableSchema } = require('graphql-tools'); | |
const events = [{ | |
id: 1, | |
name: 'APIs and IPAs', | |
description: 'Cool event', | |
startTime: 'evening', | |
endTime: 'late evening' |
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
function switchProfile(profile) | |
local karabiner = "'/Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_cli' --select-profile " | |
print('Switching profile to "' .. profile .. '"') | |
hs.execute(karabiner .. "'" .. profile .. "'"); | |
end | |
function isKeyboard(device) | |
return string.find(device["productName"], 'Keyboard') ~= nil | |
end |
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
$('[data-counter]').each(function(i, n) { | |
runCounter($(n)); | |
}); | |
function runCounter($el) { | |
var target = +$el.data('counter'); | |
var step = +($el.data('step') || Math.floor(target / 711) + 2); | |
var commas = ''+$el.data('commas') === 'false' ? false : true; | |
var value = 0; |
NewerOlder