Skip to content

Instantly share code, notes, and snippets.

View gist:e767a18078f82d26813a1306a296f0b4
"list": [
"url": "",
"recursive": false
View gist:4ef68a7be81f2147f75c4143f09f1656
curl -v -XDELETE -H "Authorization: Bearer 45fb25e40e33a4ee2e0289050486ee594cb8cca2371b00e38e9b1f5f69c9ac4d"
* Trying
* Connected to ( port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 597 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
* server certificate verification OK
* server certificate status verification SKIPPED
* common name: * (matched)
View stackpath-origin-delete.txt
curl -XDELETE -H "Authorization: Bearer xxx"
"error": "The origin you specified could not be found",
"code": 404
}% ➜ benchmark curl -v -XDELETE -H "Authorization: Bearer xxx"
* Trying
* Connected to ( port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 597 certificates in /etc/ssl/certs
View bump-core
if [[ -z $PARENT || -z $VERSION ]]; then
echo "Usage: $0 <dir-with-repos> <core-version>"
exit 1
View Travel Time Estimates
Newark - Travel Time Estimates
Distance from Caffe Gelato to Peace A Pizza
274m (1m)
Distance from Caffe Gelato to Mario's Pizza
4093m (7m)
Distance from Caffe Gelato to Del Pez
160m (1m)
mikejholly / gist:759ee1747b5ddb5ba052
Created Mar 11, 2015
Knuth Algorithm U Set Partitions
View gist:759ee1747b5ddb5ba052
class Partitioner
def initialize(ns, m)
@ns = ns
@m = m
def partitions()
n = @ns.length
a = [0] * (n + 1)


Longshoreman automates application deployment using Docker. Create a Docker repository (or use a service), configure the cluster using AWS or Digital Ocean (or whatever you like) and deploy applications using a Heroku-like CLI tool. We're currently using it in production at Wayfinder.


We created Longshoreman because we fell in love with Docker but were frustrated with the lack of production-ready deployment options that were available at the time. We looked closely at Deis, Flynn, Dokku and others, but they either did not meet our requirements or were explicitly marked as non ready for production. We were extremely impressed by Deis in particular and it's use of bleeding edge technologies like CoreOS, etcd and systemd. The biggest complaint we have about Deis is it's inability to relaunch applications using the Docker registry (at least when we last researched it).


View gist:8474441
# Get API token for authorization header
token = session.get "apiToken"
id = record.get "_id"
xhr = new XMLHttpRequest()
xhr.onreadystatechange = ->
console.log arguments "DELETE", "http://#{}/api/v1/pathways/#{id}"
xhr.setRequestHeader "Authorization", "Token token=#{token}"
View gist:5959425
// Check for token
if (empty($_REQUEST['jwt'])) {
return drupal_not_found();
// Load token
$payload = $_REQUEST['jwt'];
mikejholly / gist:5347776
Created Apr 9, 2013
Check out this highly readable bit of JS from Drupal wysiwyg.
View gist:5347776
Drupal.wysiwyg.editor.attach[params.editor](context, params, (Drupal.settings.wysiwyg.configs[params.editor] ? jQuery.extend(true, {}, Drupal.settings.wysiwyg.configs[params.editor][params.format]) : {}));