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
@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)
#!/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
# 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]) : {}));
<?php
function screenshot_url($url) {
$token = md5($url . $secret);
$img = "http://api.screenshotshark.com/$key/$token/png/?url=" . urlencode($url);
}
?>
<img src='<?php echo screenshot_url("http://news.google.com") ?>' />
@mikejholly
mikejholly / gist:3724921
Created September 14, 2012 21:19
PHP Recursion Fun
<?php
$a = array(
'foo' => array(
'bar' => array(
'baz' => 'foo',
'bar' => array(
'loo' => 'poo'
),
),