This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# please use 2.4.0+ | |
# Recursively searches your directory of repos to find the specified regex in commit messages, | |
# and produces a histogram by author. | |
# e.g. "./commitsearch.rb 'fu*ck'" | |
authors = [] | |
Dir.glob('*').select { |f| File.directory? f } .sort .each do |d| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
var LINTER_BUTTON_TEXT = 'Lint comment'; | |
var BAD_WORDS = []; | |
var LINTER_MEMO = {}; | |
function memoized(input) { | |
if (input in LINTER_MEMO === true) { | |
return LINTER_MEMO[input]; | |
} | |
LINTER_MEMO[input] = checkWord(input); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Example python implementation of K-nearest neighbor machine learning algorithm | |
''' | |
from collections import Counter | |
import random | |
class KNNClassifier(object): | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from | to | weighted_rep | weighted_ind | weighted_dem | unweighted_rep | unweighted_ind | unweighted_dem | |
---|---|---|---|---|---|---|---|---|
1/20/17 | 1/29/17 | 0.2492 | 0.1848 | 0.0325 | 0.89 | 0.42 | 0.13 | |
1/30/17 | 2/5/17 | 0.2666 | 0.1517 | 0.0248 | 0.86 | 0.41 | 0.08 | |
2/6/17 | 2/12/17 | 0.2697 | 0.1295 | 0.0341 | 0.87 | 0.35 | 0.11 | |
2/13/17 | 2/19/17 | 0.2666 | 0.1369 | 0.0217 | 0.86 | 0.37 | 0.07 | |
2/20/17 | 2/26/17 | 0.2728 | 0.1406 | 0.031 | 0.88 | 0.38 | 0.1 | |
2/27/17 | 3/5/17 | 0.2288 | 0.1638 | 0.03 | 0.88 | 0.39 | 0.1 | |
3/6/17 | 3/12/17 | 0.2288 | 0.1512 | 0.027 | 0.88 | 0.36 | 0.09 | |
3/13/17 | 3/19/17 | 0.2236 | 0.147 | 0.03 | 0.86 | 0.35 | 0.1 | |
3/20/17 | 3/26/17 | 0.2184 | 0.1386 | 0.024 | 0.84 | 0.33 | 0.08 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
svg { | |
background: black; | |
} | |
.node { | |
font: 300 11px "Helvetica Neue", Helvetica, Arial, sans-serif; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
url: "evening.html", | |
}).done(function(data) { | |
var post = $(data); | |
window.graph.nodes.push({ | |
"id": "front-page post", | |
"user": "front-page post" | |
}) | |
post.find('.comment').each(function() { | |
var cmt = $(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
import cPickle as pickle | |
except: | |
import pickle | |
from twitter import * | |
import datetime | |
token = '' | |
token_key = '' |