Skip to content

Instantly share code, notes, and snippets.

Working:
{
"list": [
{
"url": "https://mholly.nyc3.cdn.digitaloceanspaces.com/cdn.txt",
"recursive": false
}
]
}
curl -v -XDELETE -H "Authorization: Bearer 45fb25e40e33a4ee2e0289050486ee594cb8cca2371b00e38e9b1f5f69c9ac4d" https://striketracker.highwinds.com/api/v1/accounts/k7w4h9z7/origins/67497
* Trying 209.197.3.40...
* Connected to striketracker.highwinds.com (209.197.3.40) 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: *.striketracker.highwinds.com (matched)
curl -XDELETE -H "Authorization: Bearer xxx" https://striketracker.highwinds.com/api/v1/accounts/k7w4h9z7/origins/66995
{
"error": "The origin you specified could not be found",
"code": 404
}% ➜ benchmark curl -v -XDELETE -H "Authorization: Bearer xxx" https://striketracker.highwinds.com/api/v1/accounts/k7w4h9z7/origins/66996
* Trying 209.197.3.40...
* Connected to striketracker.highwinds.com (209.197.3.40) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 597 certificates in /etc/ssl/certs
#!/bin/bash
PARENT=$1
VERSION=$2
BRANCH=feature/core-bump-$VERSION
if [[ -z $PARENT || -z $VERSION ]]; then
echo "Usage: $0 <dir-with-repos> <core-version>"
exit 1
fi
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
mikejholly / gist:759ee1747b5ddb5ba052
Created March 11, 2015 03:01
Knuth Algorithm U Set Partitions
class Partitioner
def initialize(ns, m)
@ns = ns
@m = m
end
def partitions()
n = @ns.length
a = [0] * (n + 1)
@mikejholly
mikejholly / longshoreman.md
Last active August 29, 2015 14:02
Longshoreman

Longshoreman

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.

Why?

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).

How?

# Get API token for authorization header
token = session.get "apiToken"
id = record.get "_id"
###
xhr = new XMLHttpRequest()
xhr.onreadystatechange = ->
console.log arguments
xhr.open "DELETE", "http://#{ENV.domains.crud}/api/v1/pathways/#{id}"
xhr.setRequestHeader "Authorization", "Token token=#{token}"
<?php
// Check for token
if (empty($_REQUEST['jwt'])) {
return drupal_not_found();
}
// Load token
$payload = $_REQUEST['jwt'];
@mikejholly
mikejholly / gist:5347776
Created April 9, 2013 17:45
Check out this highly readable bit of JS from Drupal wysiwyg.
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]) : {}));