Skip to content

Instantly share code, notes, and snippets.

View megantaylor's full-sized avatar

Megan Taylor megantaylor

View GitHub Profile
@paulirish
paulirish / gist:526168
Created August 16, 2010 00:42 — forked from anonymous/>
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- According to Heather Champ, former community manager at flickr,
you should not allow search engines to index your "Contact Us"
require 'rubygems'
require 'yajl/json_gem'
module AP
# a = AP::ParseData.new('/file.txt')
class ParseData
def initialize(file)
@file = file
@ap_scratch = []
@final_results = []
@charliepark
charliepark / hatchshow.js
Created July 30, 2011 16:07
A jquery typography plugin.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(window).load(function(){
$().hatchShow();
});
jQuery.fn.hatchShow = function(){
$('.hsjs').css('display','inner-block').css('white-space','pre').each(function(){
var t = $(this);
t.wrap("<span class='hatchshow_temp' style='display:block'>");
var pw = t.parent().width();
@jkeefe
jkeefe / wnyc.addressbox.js
Created November 2, 2011 05:13
Address Box Code
/////////
//
// Things you need in place to use this:
// - have loaded jquery
// - have called your google map "map" and declared it globally
// such as: var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
// - have <div id="address_module"></div> where you want your address box
// - call addressBoxSetup(); in your $(document).ready(function(){ ... });
//
//
@markng
markng / part1.py
Created February 25, 2012 04:34
Web Scraping NICAR Python class
import requests
import csv
from pyquery import PyQuery as pq
f = open('strike_all_bills.csv', 'w')
wr = csv.DictWriter(f, ['billno'])
req = requests.get('http://www.azleg.gov/StrikeEverything.asp')
html = pq(req.text)
rows = html('tr.TableHeaderBackground').siblings()
@luetkemj
luetkemj / wp-query-ref.php
Last active April 25, 2024 09:37
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@nijikokun
nijikokun / example-user.js
Created May 3, 2012 20:46
Beautiful Validation... Why have I never thought of this before?!
var user = {
validateCredentials: function (username, password) {
return (
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' }
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' }
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' }
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' }
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' }
: false
);
@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

@ksmiley
ksmiley / congress_tweets.py
Created October 2, 2012 02:37
Python ports of two Ruby scripts used in Dan Nguyen's class at ONA.
import urllib2
# Python port of this Ruby script: http://pastebin.com/VHnSRs3t
# Bring in two helper functions from our code library.
from scraper_helper import get_twitter_user, get_user_tweets
# URL for a file with a list of Congress members' Twitter names.
csv_url = "http://nottwitter.danwin.com.s3.amazonaws.com/cmembers.txt"
# Name of a file (on your hard drive) to hold the script results.
@ryanpitts
ryanpitts / ZenOfNewsApps
Last active October 12, 2015 20:18
Quotes to inspire news nerds.
#ADRIA, F.
"We didn't create dishes. We create preparations to create many dishes." - Ferran Adria
#BOURDAIN, A.
"This bus makes many stops. I have no expectation that you will like all of them." - @Bourdain
#BOYER, B.
"Election maps lie." - @brianboyer
"Who are our users? What do they need?" - @brianboyer