👨👩👧👦
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
class Thing { | |
val = null; | |
constructor(val) { | |
this.val = val; | |
} | |
unwrap() { | |
throw "unimplemented!"; | |
} | |
is_ok() { |
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
library("readr") | |
data <-read_csv("https://raw.githubusercontent.com/propublica/compas-analysis/master/compas-scores-two-years.csv") | |
library("dplyr") | |
data <- filter(data, type_of_assessment=="Risk of Recidivism") | |
library("ggplot2") | |
ggplot(data=filter(data, race =="African-American"), aes(ordered(decile_score))) + geom_bar() | |
ggplot(data=filter(data, race =="Caucasian"), aes(ordered(decile_score))) + geom_bar() | |
ggplot(data, aes(race, decile_score)) + geom_boxplot(notch=TRUE) | |
means <- filter(data, race == "Caucasian" | race == "African-American") | |
means <- mutate(data, white = race == "Caucasian") |
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
;;; jeffs-init --- various bits and boops to make emacs a nicer place | |
;;; Commentary: | |
;; Too many late nights copying and pasting from the internet, | |
;; but hey I'm proud of it. | |
;;; Code: | |
;; Configuration | |
(setq gc-cons-threshold 100000000) |
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
{ | |
"id":402181258, | |
"id_str":"402181258", | |
"name":"Richard \u261d\ud83c\udffbSpencer", | |
"screen_name":"RichardBSpencer", | |
"location":"Alexandria, VA", | |
"profile_location":null, | |
"description":"Co-Editor of https:\/\/t.co\/TBcoNIGaHJ. President of The National Policy Institute. Support: https:\/\/t.co\/FmiNPpJQZd Media: hello@richardbspencer.com.", | |
"url":"https:\/\/t.co\/1kKtYmOvjG", | |
"entities":{ |
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
// Takes an adjacency list like: | |
// { 1: [2, 3], 2: [1, 3], 3: [2, 1] } | |
function pick(arr) { | |
var idx = (arr.length * Math.random()) | 0; | |
return arr[idx]; | |
} | |
function remove(arr, el){ | |
var idx; |
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
require 'rubygems' | |
require 'mail' | |
Dir["./**/*.mbox"].each do |file| | |
puts "processing #{file}" | |
dir = File.basename file | |
puts "placing into #{dir}" | |
messages = File.read(file).split(/^From .*$/).reject{|m| m.blank? }.map {|m| Mail.read_from_string m } | |
puts "found #{messages.length} messages" | |
messages.each_with_index do |m, i| |
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
class EmailParser | |
attr_accessor :email | |
attr_writer :date | |
def initialize(email, id=nil) | |
@email = Mail.read_from_string email | |
@id = id | |
end | |
delegate :to => :email |
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
require 'rubygems' | |
require 'matrix' | |
require 'lingua/stemmer' | |
require 'csv' | |
require 'erb' | |
require 'iconv' | |
require 'sanitize' | |
require './cleaner.rb' | |
STEMMER = Lingua::Stemmer.new |
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
$(".TS-year_notch_year_text").each(function(){ | |
var el = $(this); | |
var text = el.text(); | |
text = text.replace(/(\d?\d:\d\d) ((a\.m\.|p\.m\.))/, function(date, time, ampm){ | |
var hourMinute = _.map(time.split(":"), function(it){ return parseInt(it, 10); }); | |
if(ampm === "p.m.") { | |
hourMinute[0] = hourMinute[0] + 12; | |
} else if(ampm === "a.m." && hourMinute[0] === 12) hourMinute[0] = 0; | |
return hourMinute.join("."); | |
}); |
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
import asyncio | |
import aiohttp | |
import os | |
import random | |
import re | |
import sys | |
import traceback | |
from io import StringIO | |
from lxml.html import parse, make_links_absolute | |
from lxml.cssselect import CSSSelector |