Skip to content

Instantly share code, notes, and snippets.

View AlexMRuch's full-sized avatar

Alex Ruch AlexMRuch

View GitHub Profile
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@thiagomarzagao
thiagomarzagao / mcq.py
Last active May 4, 2020 01:50
The Python script below implements the “Fightin’ Words” algorithm (see Monroe, B., Colaresi, M., Quinn, K. Fightin’ words: lexical feature selection and evaluation for identifying the content of political conflict. Political Analysis, 16(4), pp. 372-403). It takes as inputs word-frequency matrices. These matrices must be in CSV format. The first…
### FIGHTIN' WORDS (MCQ-2008)
### author: Thiago Marzagao
### contact: marzagao ddott 1 at osu ddott edu
import os
import sys
import pandas as pd
import numpy as np
from numpy import matrix as m
@technoweenie
technoweenie / gist:1072829
Created July 8, 2011 21:12
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
import numpy as np
import random
import math
from scipy.special import gamma,gammaln
from scipy import weave
import sys
import collections
from libbayes import discrete, gamma_pdf, slice_sample, exp_pdf
from libbayes import single_collapsed_likelihood as scl
from toputils import get_words