Skip to content

Instantly share code, notes, and snippets.

View jeresig's full-sized avatar

John Resig jeresig

View GitHub Profile
@jeresig
jeresig / output.txt
Last active September 5, 2017 10:43
worker-nodes big data transfer performance
$ node test_server.js
simple: 337.425ms
simple2: 1.971ms
big data: 3385.748ms
big data stringify: 801.013ms
big string: 565.437ms
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();
@jeresig
jeresig / block-puzzle.js
Created December 27, 2016 21:15
Super-hacky solver for the "Gopher Holes" puzzle: http://amzn.to/2hqLO2V
/**
* 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!
*
@jeresig
jeresig / frick.json
Last active February 15, 2016 22:05
Sample artwork metadata records for PHAROS Images.
{
"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
@media screen and (max-width: 719px) {
.nytint-upshot-stream-item-bCol {
margin: 0;
}
.nytint-upshot-stream-item .photo.embedded.layout-large-horizontal,
.nytint-upshot-stream-item-article .story-heading {
max-width: 100%;
}

Keybase proof

I hereby claim:

  • I am jeresig on github.
  • I am jeresig (https://keybase.io/jeresig) on keybase.
  • I have a public key whose fingerprint is 1720 9477 977B 343F EC42 B6D4 1E87 2B3A D262 C861

To claim this, I am signing this object:

@jeresig
jeresig / cookiebot.js
Last active October 5, 2023 12:20
Simple bot for CookieClicker: http://orteil.dashnet.org/cookieclicker/ How to use: Paste the following into the JavaScript console in your browser and run it. To start the bot type: "CookieClicker.start();" to stop it do: "CookieClicker.stop();" (or just reload the page).
CookieClicker = {
start: function() {
this.clickInterval = setInterval(function(){
// Click the large cookie as fast as possible!
document.getElementById("bigCookie").click();
}, 1);
this.goldInterval = setInterval(function(){
// Click the golden cookie
var shimmer = document.getElementsByClassName("shimmer")[0];
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) {
#!/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}\") \\}\\}}"
@jeresig
jeresig / .vimrc
Created May 4, 2011 16:46
VIM Config
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