This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.util.UUID; | |
import org.eclipse.jgit.api.Git; | |
public class TestUnstash { | |
public static void main(String[] args) throws Exception { | |
File directory = new File(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString()); | |
directory.mkdir(); | |
File.createTempFile("blank", null, directory); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @match http://traintimes.org.uk/* | |
// ==/UserScript== | |
(function() { | |
var icals = document.getElementsByClassName("ical"); | |
for (var i = 0; i < icals.length; i++) { | |
icals[i].href = 'http://markwoodbridge.appspot.com/ical?url=' + encodeURIComponent(icals[i].href); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns genetic.core) | |
(def letters | |
(conj (map (comp char | |
(partial + 97)) | |
(range 26)) | |
\space)) | |
(defn random-string [source] | |
(let [length (count source)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
echo {\"type\": \"GeometryCollection\", \"geometries\": [ | |
sep= | |
while read ip ; do | |
coordinates=$(curl -s freegeoip.net/csv/$ip | csvtool col 9,8 -) | |
echo $sep{\"type\": \"Point\", \"coordinates\": [$coordinates]} | |
sep=, | |
done | |
echo ]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
{{> hello}} | |
</body> | |
<template name="hello"> | |
{{#with people}} | |
{{count}} | |
{{/with}} | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
--- | |
<feed xmlns="http://www.w3.org/2005/Atom"> | |
<title>{{site.title}}</title> | |
<id>http://{{site.domain}}/</id> | |
<updated>{{site.time | date_to_xmlschema}}</updated> | |
<link href="http://{{site.domain}}/blog.xml" rel="self"/> | |
{% for post in site.posts %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hash(object, algorithm, encoding) { | |
var h = require('crypto').createHash(algorithm || 'md5'); | |
(function update(v, k) { | |
if (k !== undefined) { | |
h.update(JSON.stringify(k)); | |
} | |
if (v && v.constructor === Array) { | |
v.forEach(function(value) { | |
update(h, value); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jq -r '["List", "Card"], ((reduce .lists[] as $list ({}; .[$list.id] = $list.name)) as $lists | .cards[] | select(.closed != true) | [$lists[.idList],.name]) | @csv' <nw3RUeLl.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dependencies": { | |
"underscore": "^1.8.3", | |
"vorpal": "^1.4.0", | |
"ws": "^0.8.1" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu -o pipefail | |
cmd="curl -s --user 'api:$MAILGUN_API_KEY' https://api.mailgun.net/v2/$MAILGUN_DOMAIN/messages" | |
while getopts "r:c:b:s:a:E" opt; do | |
case $opt in | |
r) | |
cmd+=" -F from='$OPTARG'" | |
;; |
OlderNewer