Skip to content

Instantly share code, notes, and snippets.

View AmeliaMN's full-sized avatar

Amelia McNamara AmeliaMN

View GitHub Profile
@AmeliaMN
AmeliaMN / gist:c2e75ca0da51232dd2f8200646fd24c5
Created November 11, 2022 15:06
Using rtweet to gather friends and followers
library(rtweet)
# need to authenticate
auth_setup_default()
# get people you follow
friends <- get_friends("AmeliaMN")
friend_screennames <- lookup_users(friends$to_id)
# get people who follow you
followers <- get_followers("AmeliaMN", n = 200000)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Medium Length Professional CV - RESUME CLASS FILE
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% This class file defines the structure and design of the template.
%
% Original header:
% Copyright (C) 2010 by Trey Hunner
@AmeliaMN
AmeliaMN / FinalPaperJSProject.js
Last active December 10, 2015 14:49
A silly take on word clouds (the mullets of the internet) which lets you paint with words from trends on twitter. Written in Paper.js
var values = {
place: 'US',
trend: null
};
var components = {
place: {
type: 'list',
label: 'Place',
options: ['US', 'World'],
onChange: function() {
@AmeliaMN
AmeliaMN / CaliforniaBN.R
Created October 24, 2012 18:41
Spatial analysis of Barnes and Noble bookstores in CA
#Packages
library(fields)
library(sm)
library(spatstat)
library(splancs)
library(spatial)
library(geoR)
library(maps)
library(maptools)
@AmeliaMN
AmeliaMN / McNamaraCV.tex
Last active October 7, 2022 18:47
My CV
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This document is based on a template available at
% http://www.LaTeXTemplates.com
%
% Original author:
% Trey Hunner (http://www.treyhunner.com/)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
@AmeliaMN
AmeliaMN / API.py
Created October 23, 2012 21:48
Twitter and Facebook API introduction
# Twitter API
# In order to do the authenticated version, you need to download a ton of modules.
# Once you have a specific module on your desktop, move in to your home folder.
# Then, in the terminal window, cd to the folder. Once you're inside the folder, type
# python setup.py build
# python setup.py install
# python setup.py test
@AmeliaMN
AmeliaMN / recipe.py
Created October 22, 2012 18:25
Python example: Recipe parsing
#!/usr/local/bin/python
#import the modules we will be using in the code
import sys,re,os
#Create a text file to store all the recipe information
filename = "recipes.txt" #What our output file will be named
FILE = open(filename,"wr") #Opens recipes.txt and defines it readable and writable
broken=open("broken.txt","w") #Opens broken.txt and defines it to be writable
#Defining uppercase to be any line that has all uppercase letters
uppercase = "^(\s*[A-Z\s]){3,}\n";
@AmeliaMN
AmeliaMN / ODEmovie.m
Created October 22, 2012 18:21
Matlab example: Creating a movie of ODE results
function M = longmovie2(Yfile,Tfile,x,y,n)
dbstop if error
dbstop if naninf
dbstop if warning
fid1=fopen(Yfile,'r');
fid2=fopen(Tfile,'r');
T=fread(fid2,inf,'double');
T=T.';
@AmeliaMN
AmeliaMN / boxtweets.R
Created October 22, 2012 18:15
R plotting example: Box office performance and tweets
# Data came in a series of directories named for major movies,
# each containing a variable number of files of corresponding tweets.
# Function that determines the number of tweets for a movie, given the name of the directory where the files reside.
numtweets=function(moviedir){
files=list.files(moviedir, full.names=TRUE)
x={}
howmany=0
for (i in 1:length(files)){
appending=readLines(files[i])
@AmeliaMN
AmeliaMN / algebra.tex
Created October 22, 2012 17:48
LaTeX example (Beamer and TikZ): Algebraic structures
%-------------------------------------------------------------------------------
\newcommand{\efivebig}{\begin{tikzpicture}[xscale=.8,yscale=.8,line width=2pt]
\foreach \i in {1,...,5}
{ \path (\i,1) coordinate (T\i); \path (\i,0) coordinate (B\i); }
%%%%%%%
\filldraw[fill= black!12,draw=black!12,line width=4pt] (T1) -- (T5) -- (B5) -- (B1) -- (T1);
\draw[blue] (T3) .. controls +(.1,-.5) and +(-.1,-.5) .. (T4) ;
\draw[blue] (B3) .. controls +(.1,.3) and +(-.1,.3) .. (B4) ;
\draw[blue] (T1) -- (B1);
\draw[blue] (T2) -- (B2);