Skip to content

Instantly share code, notes, and snippets.

@wboykinm
wboykinm / zcta_accuracy.csv
Last active July 7, 2017 20:56
Fraction of residential addresses in each state where ZIP Code disagrees with ZIP Code Tabulation Area (ZCTA)
state disagreement
AK 0.010694866
AL 0.018366074
AR 0.018639233
AZ 0.01110696
CA 0.007925225
CO 0.008944289
CT 0.008035614
DC 0.029248933
DE 0.014817887
@zcaceres
zcaceres / Eyeballing-This.md
Last active August 17, 2023 23:38
Understanding Binding and 'this' in Javascript by zach.dev

How to Eyeball Your ‘This’ Context in Javascript

The early programmer struggles with the Javascript keyword this. But understanding your this context is easier than it seems.

This is all about where a function is invoked. Often, early programmers worry about where the function was declared. Perhaps the function was declared in a specific file or a particular object. Surely this changes it's this!

Nope.

@fitnr
fitnr / bookmarklet-replaceTextWithFontSize
Last active January 9, 2017 11:31
Replaces all text on a page with the font size. Useful for debugging the page or just replacing wretched content with something less awful.
javascript:%28function%28%29%7Bvar%20n,walk=document.createTreeWalker%28document.body,NodeFilter.SHOW_TEXT,null,0%29%3Bwhile%28n=walk.nextNode%28%29%29%7Bif(n.textContent.trim%28%29.length>0)n.textContent=window.getComputedStyle(n.parentNode).fontSize%3B%7D%7D%29%28%29

Mexican Street Corn Cookies

mexican_street_corn_cookies A cookie inspired by the wonderful street corn of Mexico City (and various US cities).

Cookies

Ingredients

  • 225 g butter, room temperature
  • 300 g sugar
  • 1 egg
@dannguyen
dannguyen / gender-detector-front-page-news.md
Last active May 11, 2020 17:28
Gender detection for formal news sites

Command-line gender analysis of New York Times articles, using wget and regex and highly simplified domain-specific methodology

This is a short proof-of-concept of how to use pattern matching and batch-downloading -- and, well, careful reading of New York Times style -- to perform a quickie gender analysis of New York Times articles by website section.

Sloppy analysis: Across virtually all of the nytimes.com section fronts, mentions of men outnumber women, except for Weddings (roughly 200 vs 190, Ms. vs Mr). Previous explanations for this phenomenon have generally boiled down to - more men are in the kinds of positions that get written about.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexpchin
alexpchin / Ruby_Rails_Naming_Conventions.md
Created May 8, 2014 10:56
Ruby & Rails Naming Conventions

Alex's Rails Cheat Sheet

I think the most confusing thing that I have found about Ruby on Rails so far has been the transition from (trying to) write code myself to the use of the fabled "Rails Magic". So, to help my own understanding of a few core Ruby on Rails concepts, I have decided to write something on what I think is a CRITICAL topic... the idea of Convention over Configuration and why (in my mind) it is the most important thing that helps Rails become magic!

(This may be a topic that we cover in more detail in class but as I said, I'm writing this for my own understanding... I hope it helps someone else understand things too... Perhaps you can give me a hand when I'm crying next week!)

##Convention over configuration ###What does this "actually" mean...

@jeremyjbowers
jeremyjbowers / red_velvet_cake.md
Last active March 30, 2022 17:33
Georgia Red Velvet Cake

Red Velvet Cake

Red Velvet cake recipe Red Velvet cake finished

Cake

Ingredients

From original recipe