This file contains 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
#!/usr/bin/env ruby | |
$: << ENV['TM_SUPPORT_PATH'] + '/lib' | |
require 'escape' | |
def esc(str) | |
e_sn(str).gsub(/\}/, '\\}').gsub(/"/, '\\\\"') | |
end | |
s = STDIN.read | |
if ENV.has_key? 'TM_SELECTED_TEXT' | |
print "${1:{{ __(\"#{esc s}\") \\}\\}}" |
This file contains 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 Vb(d) { | |
d = d | 0; | |
var e = 0, f = 0, h = 0, j = 0, k = 0, l = 0, m = 0, n = 0, | |
o = 0, p = 0, q = 0, r = 0, s = 0; | |
e = i; | |
i = i + 12 | 0; | |
f = e | 0; | |
h = d + 12 | 0; | |
j = c[h >> 2] | 0; | |
if ((j | 0) > 0) { |
This file contains 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
{ | |
"id": "b11104624", | |
"url": "http://arcade.nyarc.org/record=b1110462~S7", | |
"lang": "en", | |
"title": "S. John the Baptist Enthroned and Twelve Scenes from His Life.", | |
"dates": [ | |
{ | |
"start": 1200, | |
"end": 1299, | |
"circa": false |
This file contains 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
/** | |
* Super-hacky solver for the "Gopher Holes" puzzle: | |
* http://amzn.to/2hqLO2V | |
* | |
* Note: I assumed that the blocks would be going vertically in one direction | |
* and horizontally in another. | |
* | |
* Also: I wrote this for fun over the holidays - I'm sure this code is | |
* terrible and could be improved. It was good enough for my needs! | |
* |
This file contains 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
tap.test("RecordImport.advance", (t) => { | |
const checkStates = (batches, states) => { | |
t.equal(batches.length, states.length); | |
for (const batch of batches) { | |
t.equal(batch.state, states.shift()); | |
t.ok(batch.getCurState().name(i18n)); | |
} | |
}; | |
const batch = init.getRecordBatch(); |
This file contains 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
$ node test_server.js | |
simple: 337.425ms | |
simple2: 1.971ms | |
big data: 3385.748ms | |
big data stringify: 801.013ms | |
big string: 565.437ms |
This file contains 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
# Rename an email address in all old commits. | |
# WARNING: Will change all your commit SHA1s. | |
# Based off of the script from here: | |
# http://coffee.geek.nz/how-change-author-git.html | |
git filter-branch -f --commit-filter ' | |
if [ "$GIT_COMMITTER_EMAIL" = "joern.zaefferer@googlemail.com" ]; | |
then | |
GIT_AUTHOR_EMAIL="joern.zaefferer@gmail.com"; | |
GIT_COMMITTER_EMAIL="joern.zaefferer@gmail.com"; | |
git commit-tree "$@"; |
This file contains 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
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery | |
set nocompatible | |
set autoindent | |
set tabstop=2 | |
set showmatch | |
set vb t_vb= | |
set ruler | |
set nohls | |
set incsearch | |
syntax on |
This file contains 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
// Slightly rewritten code from here: | |
// http://blog.mozilla.com/webdev/2009/08/06/html5-audio-soundboard/ | |
$("audio").removeAttr("controls").each(function(i, audio) { | |
$('<button>') | |
.text( $(this).attr("title") ) | |
.click(function() { | |
audio.play(); | |
)) | |
.appendTo("#doc"); | |
}); |
OlderNewer