Skip to content

Instantly share code, notes, and snippets.

View afeld's full-sized avatar

Aidan Feldman afeld

View GitHub Profile
@afeld
afeld / gist:5114389
Created March 8, 2013 05:27
JSONP failed deploy, after switching to free open-source plan
{
"_id":"659f632137e5bf99fb7e49caed006459",
"_rev":"2-832c2ae4a7472636d852c9ad1517b9a2",
"status":"ok",
"payload":{
"id":5334632,
"repository":{
"id":63478,
"name":"jsonp",
"owner_name":"afeld",
@afeld
afeld / gist:5201086
Last active August 17, 2023 18:43
job boards
@afeld
afeld / gist:5242219
Last active December 15, 2015 09:59
HTML markup string that fails to be parsed by jQuery 1.9.1. Removing the leading and trailing whitespace fixes the problem.
<div class="galleryRow rowOf2">
<div class="introPanel xsome rowOf2-0 groupOf0 galleryPreview medium" data-gallery-id="5112c78b932b6315e6000115" data-xsome-size="0"><div class="introPanel-inner"><a href="http://gimli.aidan.jux.nu:8080/"><div class="galleryInfo"><div class="cornerButton"></div><div class="galleryInfo-child descriptionLinksEmpty"><div class="galleryInfo-sub-child"><div class="gallery-title"><div class="titleWrapper"><div class="juxTitle">EVERYTHING</div></div><div class="juxByline">by <span class="authordisplayname" data-empty-value="gimli" spellcheck="false">gimli</span></div></div><div class="galleryInfo-descriptionAndLinks" data-elem="descriptionAndLinks"><div class="juxByline">by <span class="authordisplayname" data-empty-value="gimli" spellcheck="false">gimli</span></div></div></div></div></div></a><div class="clear"></div></div></div>
<div class="introPanel xsome rowOf2-1 groupOf0 galleryPreview large" data-gallery-id="5112c78a932b6315e60000ea" data-xsome-size="0"><div class=
@afeld
afeld / gist:5285885
Created April 1, 2013 16:11
kittenbomb
$(function(){
var kittenize = function(){
$('.fillmoreInner:not(.kitten)').each(function(i, el){
var $el = $(el);
var url = 'url("http://placekitten.com/' + $el.width() + '/' + $el.height() + '")';
$el.css('background-image', url);
$el.addClass('kitten');
});
$('img:not(.kitten)').each(function(i, el){
@afeld
afeld / group_by_new.rb
Last active December 16, 2015 23:49
ActiveRecord group_by performance. All the "USING BLOCK" tests are directly or indirectly using `Enumerable#group_by`, whereas the "USING SYMBOL" tests are using the new `ActiveRecord::FinderMethods#group_by`.
require 'benchmark'
require File.expand_path('../../../load_paths', __FILE__)
require "active_record"
RECORDS = 20000
conn = { :adapter => 'sqlite3', :database => ':memory:' }
@afeld
afeld / gist:5544426
Created May 8, 2013 23:20
show status of a bunch of git directories
for D in `find . -type d -depth 1`
do
cd $D
echo $D
git status
cd - > /dev/null
done
@afeld
afeld / gist:5588226
Created May 15, 2013 23:23
Node.js Code Review Panel projects
@afeld
afeld / README.md
Last active April 12, 2019 06:17
Twitter bio search

A friend is looking for a new tech job and asked if I knew anyone at a handful of companies. I'm (meaningfully) connected to more people who are relevant to this on Twitter than LinkedIn, so figured it would be easiest to scour people's bios. Naturally, I did this in the nerdiest way possible and automated it.

<3 @aidanfeldman

P.S. See also:

@afeld
afeld / zero_to_domready.md
Last active December 17, 2015 16:49
Zero to DOMReady proposal

Zero to DOMReady

This is a talk about getting your page to load for visitors...fast. We will cover: streaming, prefetching, script loading techniques, data bootstrapping, caching, and more. We'll look at some real-world examples, and do some live demos to see just how big an impact these considerations can make.

@afeld
afeld / gist:5680195
Last active December 17, 2015 22:09
CoffeeScript mixins
# a.k.a. _.extend()
extend = (obj, mixin) ->
for name, method of mixin
obj[name] = method
include = (klass, mixin) ->
extend klass.prototype, mixin
MyMixin =
foo: -> 'bar'