Skip to content

Instantly share code, notes, and snippets.

View ryancatalani's full-sized avatar

Ryan Catalani ryancatalani

View GitHub Profile
@ryancatalani
ryancatalani / ec2013_analysis.rb
Created May 12, 2013 20:38
Some methods for analyzing tweets (tuned to updates from #ec2013, the 2013 Emerson College commencement).
require "csv"
require "cgi"
require "net/http"
require "uri"
require 'nokogiri'
require 'open-uri'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
times = []
@ryancatalani
ryancatalani / analyze_tweets.rb
Last active December 16, 2015 22:09
Some methods to analyze your Twitter history.
require 'csv'
require 'net/http'
require 'uri'
require 'json'
require 'time'
replies = 0
replies_to = []
retweets = 0
retweets_from = []
@ryancatalani
ryancatalani / States_and_Countries.txt
Created November 14, 2012 00:08
Arrays of states and countries
["Alabama","Alaska","American Samoa","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","District of Columbia","Florida","Georgia","Guam","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Northern Marianas Islands","Ohio","Oklahoma","Oregon","Pennsylvania","Puerto Rico","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Virgin Islands","Washington","West Virginia","Wisconsin","Wyoming"]
"Alabama",
"Alaska",
"American Samoa",
"Arizona",
"Arkansas",
"California",
"Colorado",
"Connecticut",
@ryancatalani
ryancatalani / 1_100_top_only_lexemes.js
Created May 4, 2012 04:41
Most commonly used words in the English language
// #1: 100 top words
// Only includes lexemes. E.g. "be" is included, but not "is", "are", "were", or "was".
// From http://en.wikipedia.org/wiki/Most_common_words_in_English
["the","be","to","of","and","a","in","that","have","I","it","for","not","on","with","he","as","you","do","at","this","but","his","by","from","they","we","say","her","she","or","an","will","my","one","all","would","there","their","what","so","up","out","if","about","who","get","which","go","me","when","make","can","like","time","no","just","him","know","take","person","into","year","your","good","some","could","them","see","other","than","then","now","look","only","come","its","over","think","also","back","after","use","two","how","our","work","first","well","even","new","want","because","any","these","give","day","most","us"]
String lets = "729711211212132661051141161041009712133";
int[] spaces = {2,2,3,3,3,2,2,3,3,3,3,3,2,3,2};
int curpos = 0;
for (int i=0; i<spaces.length; i++) {
System.out.print((char)(Integer.parseInt(lets.substring(curpos,curpos+spaces[i]))));
curpos += spaces[i];