Skip to content

Instantly share code, notes, and snippets.

View greglinch's full-sized avatar

Greg Linch greglinch

View GitHub Profile
@dwillis
dwillis / gist:1189275
Created September 2, 2011 17:46
Who Needs to Write Scrapers?
cd my_download_dir
curl http://apps.sd.gov/applications/ST12ODRS/LobbyistViewlist.asp?start=[1-8101:20] -o "lobby_#1.html"
# get a cup of coffee
cat lobby*.html > master.html # on mac/linux, on windows try copy lobby*.html master.html
-----
Then open master.html in a text editor, do some smart bulk find and replaces, and you'll be in business. After opening the cleaned up file in Excel, you'll need to un-merge the cells and do a little more cleanup, but it works.
@palewire
palewire / dorling.py
Created September 20, 2011 08:26
Takes a GeoDjango queryset and creates a cartogram of circles based on the Dorling algorithm.
import math
from django.contrib.gis.geos import Point
class Cartogram(object):
"""
Takes a GeoDjango queryset and creates a cartogram of circles based on
the Dorling algorithm.
User must provide a queryset and strings pointing to the data attribute
@HarlanH
HarlanH / DSDC-Titles.R
Created September 26, 2011 12:44
Data Science DC Titles Visualization
# Data Science DC Titles Visualization
# Here's how this will work. In a main loop, a parameterized visualization function
# is called every N seconds. Each function gets the source spreadsheet fresh, and
# generates a visual.
# aspects of this code borrowed from Drew Conway:
# https://raw.github.com/drewconway/ZIA/master/R/better_word_cloud/better_word_cloud.R
library(plyr)
@eyeseast
eyeseast / gist:1519647
Created December 25, 2011 19:37
Christmas afternoon on a new laptop...
Successfully installed django django-celery django-debug-toolbar django-filebrowser django-flatblocks django-grappelli django-haystack django-memcache-status django-model-utils django-redis-cache django-smuggler django-tastypie BeautifulSoup docutils fabric feedparser geopy johnny-cache kombu mimeparse PIL psycopg2 pysolr python-memcached redis sorl-thumbnail south typogrify python-dateutil python-wordpress boto django-storages python-nameparser django-boundaryservice django-disqus django-picklefield celery python-digest ssh anyjson amqplib smartypants pycrypto
Cleaning up...
// The narrator leaks globals but we cannot know if he intends this; we are
// forced to trust him. There is no going back.
stairs =
this['stairs'] ||
{};
stairs['0'] = [],
stairs['1'] = [
0
],
stairs['2'] = [ 0, 1
@ryanpitts
ryanpitts / fuzzyboyle.py
Created November 21, 2012 18:20
A Python script using FuzzyWuzzy to find the recent @andymboyle tweet that most resembles random mashing on a keyboard.
#!/usr/bin/python
import random
import string
import twitter
from fuzzywuzzy import process
api = twitter.Api()
recent_tweets = api.GetUserTimeline('andymboyle')
tweet_list = [tweet.text for tweet in recent_tweets]
@kjam
kjam / twitter_example.html
Created July 21, 2011 15:09
Twitter Search
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.getJSON('http://search.twitter.com/search.json?q=earthquake&lang=en&callback=?', function(data) {
var data = data.results;
var html = "<ul>";
for(var i=0; i<data.length; i++) {
html += "<li><a href='http://twitter.com/" + data[i].from_user + "'>@"
@davisshaver
davisshaver / engineer.md
Last active October 29, 2015 20:26
Philadelphia Media Network – Tech/Product Jobs

The Philadelphia Media Network is seeking engineers to join a new development team within its Systems division. As an early engineering hire on this team, you will have a large role in shaping its culture, values, and workflow.

Engineer

Interested? Email us.

The technical stuff:

  • Rails experience would be great, but at least you should be willing to learn. We will be maintaining and enhancing a Rails CMS built to manage our new mobile app. Don’t worry though, you will be inheriting a stable, well-documented, and test-driven project.
  • “Fullstack” projects should be comfortable to you. We want engineers who are interested in the entire product development process – understanding needs, vetting technical approaches, planning work to be done, and engineering in an agile manner. Learning and problem solving are two of your favorite things to do.
  • Git, unit tests, and coding standards are all familiar to you, and you understand why we practice
require 'sinatra'
require 'sanitize'
TO_REMOVE = ["", " ", "&nbsp;"]
get '/' do
<<-HTML
<form method="post" action="sanitize">
<textarea name="dirty" style="width:100%;height:800px;"></textarea>
<input type="submit" value="Submit">
@taupecat
taupecat / _griddr.scss
Last active December 20, 2015 22:09
griddr: formulae and mixins to create flexible, semantic grids in Sass by setting your desired number of columns, margin width (in pixels), and container context width (in pixels). TODO: prepend and append functionality.
/**
* Formulae and mixins to create any kind of evenly-spaced flexible grid
* you can possibly imagine.
*/
/**
* Our grid settings. Change as desired for your project
*/
$columns: 12; // Desired number of columns