Skip to content

Instantly share code, notes, and snippets.

Mike Holly mikejholly

Block or report user

Report or block mikejholly

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:e767a18078f82d26813a1306a296f0b4
Working:
{
"list": [
{
"url": "https://mholly.nyc3.cdn.digitaloceanspaces.com/cdn.txt",
"recursive": false
}
]
}
View gist:4ef68a7be81f2147f75c4143f09f1656
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)
View stackpath-origin-delete.txt
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
View bump-core
#!/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
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
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
end
def partitions()
n = @ns.length
a = [0] * (n + 1)
View longshoreman.md

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?

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
xhr.open "DELETE", "http://#{ENV.domains.crud}/api/v1/pathways/#{id}"
xhr.setRequestHeader "Authorization", "Token token=#{token}"
View gist:5959425
<?php
// Check for token
if (empty($_REQUEST['jwt'])) {
return drupal_not_found();
}
// Load token
$payload = $_REQUEST['jwt'];
@mikejholly
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]) : {}));
You can’t perform that action at this time.