Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeff Larson thejefflarson

View GitHub Profile
View table.js
// Table.js is a small library for manipulating NxN arrays.
// It takes an NxN array and a list of type formatters by column headers so:
// var table = new Table([['one', 'two', 'three'], ["1","jeff larson","3px"]], {
// one : function(it) { return +it; },
// two : function(it) { return it.toUpperCase(); },
// three : function(it) { return +it.replace("px", ''); }
// });
//
var Table = function(data, types){
this.data = data;
View map.js
$(function(){
$("#article-big-image").replaceWith($("<div/>").attr({"id": "map-cont"}).html([
'<img id="background" src="//www.propublica.org/projects/migration-map/images/background.png">'
, '<img class="year year-1890" src="//www.propublica.org/projects/migration-map/images/1890.png" style="display: block;">'
, '<img class="year year-1900" src="//www.propublica.org/projects/migration-map/images/1900.png">'
, '<img class="year year-1910" src="//www.propublica.org/projects/migration-map/images/1910.png">'
, '<img class="year year-1920" src="//www.propublica.org/projects/migration-map/images/1920.png">'
, '<img class="year year-1930" src="//www.propublica.org/projects/migration-map/images/1930.png">'
, '<img class="year year-1940" src="//www.propublica.org/projects/migration-map/images/1940.png">'
, '<img class="year year-1950" src="//www.propublica.org/projects/migration-map/images/1950.png">'
View train.py
from tensorflow.keras import Input, Model
from tensorflow.keras.models import load_model
from tensorflow.keras.layers import (
Conv2D,
Activation,
MaxPooling2D,
Dropout,
Flatten,
Dense,
)
View stepper.js
/* USAGE:
$(function(){
var steps = new Stepper("#steps");
steps.addSlide(1, function(){ this.canvas.text("slide 1"); });
steps.addSlide(2, function(){ this.canvas.text("slide 2"); });
steps.go();
});
*/
View keybase.md

Keybase proof

I hereby claim:

  • I am thejefflarson on github.
  • I am thejefflarson (https://keybase.io/thejefflarson) on keybase.
  • I have a public key ASAOCcrYOEybgCz32LXRx9GKWVql6FI2-BVOfali5Qf_Ago

To claim this, I am signing this object:

View api.js
createEngine((err, engine) => {
if (err) throw err;
engine.scan(buffer, (err, result) => {
if (err) throw err;
console.log(result);
});
});
View result.js
class Thing {
val = null;
constructor(val) {
this.val = val;
}
unwrap() {
throw "unimplemented!";
}
is_ok() {
View nicar.R
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")
View init.el
;;; 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)
View spencer.json
{
"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":{
You can’t perform that action at this time.