Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
# Add field | |
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}' | |
# { | |
# "hello": "world", | |
# "foo": "bar" | |
# } | |
# Override field value | |
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}' | |
{ |
#!/bin/bash | |
trap 'kill -TERM $pid' TERM INT | |
source=$1 | |
shift | |
command=$* |
# post_loc.txt contains the json you want to post | |
# -p means to POST it | |
# -H adds an Auth header (could be Basic or Token) | |
# -T sets the Content-Type | |
# -c is concurrent clients | |
# -n is the number of requests to run in the test | |
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |
// Run this from your browser console on your meetup event page (http://www.meetup.com/AngularJS-Utah/events/183104032/) | |
(function () { | |
// Query document for attendees and select a random one | |
const list = document.querySelector('ul.attendees-list').children, | |
item = list[Math.floor(Math.random() * list.length)], | |
name = item ? item.querySelector('h4.text--bold').innerText : 'N/A'; | |
// Remove item so they can only be selected once | |
item && item.parentNode.removeChild(item); | |
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" |
/** | |
* Creates a new Uint8Array based on two different ArrayBuffers | |
* | |
* @private | |
* @param {ArrayBuffers} buffer1 The first buffer. | |
* @param {ArrayBuffers} buffer2 The second buffer. | |
* @return {ArrayBuffers} The new ArrayBuffer created out of the two. | |
*/ | |
var _appendBuffer = function(buffer1, buffer2) { | |
var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength); |
/** | |
* @license AngularJS | |
* (c) 2010-2012 AngularJS http://angularjs.org | |
* License: MIT | |
*/ | |
/** | |
* Backward compatibility module for AngularJS | |
* @author Vojta Jina <vojta.jina@gmail.com> | |
* |