Skip to content

Instantly share code, notes, and snippets.

mwrc 5k 2013 results

bib name time
126 David Collins 20:43
116 Ronny Bjarnason 21:03
118 Jon Jensen 21:28
122 Ben Mabey 22:30
109 Rick Hansen 23:42
121 Alex Kovshovik 25:11
previousjQuery = jQuery;
jQuery(function($){
// only run in browsers that can do localStorage (not IE) and only on the tickets page
if ('localStorage' in window && $('body').hasClass('tickets-show') || $('body').hasClass('tickets-new')) {
// I want to make sure that this always runs with my version of jquery, not zendesk's
$.getScript('http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js', function(){
jQuery(function($){
//var username = 'testuser';
//var password = 'testpass';
@jenseng
jenseng / gist:34b6b1e48b83270aef39
Created December 5, 2014 00:04
gerrit-submit-branch
#!/bin/bash
set -e
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) # what if no branch?
COMMON_ANCESTOR=$(git merge-base HEAD origin/master)
NUM_COMMITS=$(expr $(git log --pretty=oneline|sed -n "/$COMMON_ANCESTOR/{=; q;}") - 1)
GIT_DIR=$(git rev-parse --show-toplevel)/.git
# make sure our commit message dir and message file exist ... that way the
@jenseng
jenseng / gist:34681249b42f99ef70d9
Last active August 29, 2015 14:16
mwrc 5k results
Name Time
Paul Hoffer 21:00.40
Dallas DeVries 21:52.58
??? 22:14.86
Jon Jensen 22:35.07
Lauren Williams 23:07.99
Kent Besaw 23:35.69
Landon Wilkins 24:15.08
Jordan Dayton 25:11.76
@jenseng
jenseng / yamlcsv.rb
Created September 11, 2015 19:12
yml <-> csv thingy for transifex
#!/usr/bin/env ruby
begin
require "ya2yaml"
rescue
`gem install ya2yaml`
require "ya2yaml"
end
begin
@jenseng
jenseng / results.md
Created March 22, 2016 20:12
mwrc 5k results
Name Time
Dallas DeVries 22:31
Jon Jensen 23:05
David White 23:54
Bob Hanson 24:11
Joel Duffin 26:28
Aaron Patterson 26:28
Phin Jensen 26:50
Jeremy Stanley 27:23
@jenseng
jenseng / dumb_test.rb
Created April 3, 2017 19:31
simplecov merging race condition
#!/usr/bin/env ruby
# This demonstrates a race condition in simplecov:HEAD that occurs when you
# have several processes merging results at the same time (e.g. test-queue,
# parallel_test). The bug manifests itself as either missing coverage, or
# outright failures.
#
# Usage:
# ruby dumb_test.rb
#
@jenseng
jenseng / identiception.sh
Created June 4, 2020 18:35
identiception: reset all IDENTITY columns in postgres
# a query that finds all IDENTITY columns and then outputs
# queries that find the max value for each table and then output
# an appropriate alter table call for each one
# which we then run 3x through psql 😅🤯
#
# this assumes you have appropriate PG* variables set up, e.g.
# PGDATABASE=mydb
# PGHOST=localhost
# ...
cat<<EOF|psql -t -A|psql -t -A|psql -q
@jenseng
jenseng / root.tsx
Last active December 2, 2021 21:29
//...
export default function App() {
let location = useLocation();
React.useLayoutEffect(() => {
[...document.querySelectorAll<HTMLSpanElement>('pre[data-lang] span')]
.filter(el => ['let', 'const', 'var'].includes(el.innerText))
.forEach(el => el.innerText = ['let', 'const', 'var'][Math.floor(Math.random() * 3)]);
}, [location.pathname]);
@jenseng
jenseng / remix-node-12.md
Last active December 13, 2021 22:01
remix on node 12

YMMV, but this worked for me to get Remix working on Node 12. I'm using Restify, but this is really just Node 12 polyfill stuff so it should work with other servers/adapters:

  1. add fs.promises as a dependency
  2. make a module promises-polyfill.js with the following:
    // this polyfills promise stuff for `fs` and even makes `require('fs/promises')` work
    require('fs.promises');
    
    // we also need to polyfill `Promise.all` for remix