Skip to content

Instantly share code, notes, and snippets.

Hilary Mason hmason

Block or report user

Report or block hmason

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hmason
hmason / fetch_locu_data.py
Last active Jun 26, 2016
A quick script to fetch data from the locu api by query and zip code.
View fetch_locu_data.py
import sys
import os
import json
import csv
import time
import pickle
import requests
API_KEY = [YOUR API KEY GOES HERE]
View gist:4254104
$ whois facebook.com
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
FACEBOOK.COM.ZZZZZ.GET.LAID.AT.WWW.SWINGINGCOMMUNITY.COM
FACEBOOK.COM.MORE.INFO.AT.WWW.BEYONDWHOIS.COM
@hmason
hmason / test.sh
Created Aug 21, 2012
Did you know that bash will reload a script *while it is executing*?!
View test.sh
#!/bin/bash
function addnext {
NUM=$1
sleep 1
echo HI $NUM
NUM=$(expr $NUM + 1)
echo addnext $NUM >> $0
}
View gist:628758
import sys, os
import json
if __name__ == '__main__':
f = open("formatted_tweets.json")
data = f.read()
f.close()
tweets = json.loads(data)
View Beiber_API_Call.py
import sys, os
import urllib, urllib2
import json
def main(query, api_key):
h = urllib.urlopen("http://api.nytimes.com/svc/search/v1/article?%s" % (urllib.urlencode({'api-key': api_key, 'query': query})))
return json.loads(h.read())
if __name__ == '__main__':
print main("title:data","f7b4a1749764aec0364b215c354e3a0f:18:25759498")
View Justin_Bieber_API_Call
curl 'http://api.nytimes.com/svc/search/v1/article?query=justin%20beiber&api-key=f7b4a1749764aec0364b215c354e3a0f:18:25759498'
View gist:377742
Bitly tech talk 4/22/2010
On 4/22 we held a bit.ly tech talk on 'Command Line Fu', where we invited talented hackers to come share their best moves. Please correct my notes and add your fu here!
# @jehiah
# in place file regex replacement
perl -pi -e 's/this/that/g' filename_pattern
# print the last column of a file ($NF stands for 'Number of Fields' or more commonly Last Field).
View gist:375966
Bitly tech talk 4/22/2010
On 4/22 we held a bit.ly tech talk on 'Command Line Fu', where we invited talented hackers to come share their best moves. Please correct my notes and add your fu here!
# jehiah
# in place file regex replacement
perl -pi -e 's/this/that/g' filename_pattern
# print the last column
You can’t perform that action at this time.