Skip to content

Instantly share code, notes, and snippets.

Sam Petulla petulla

  • CNN
  • New York City
Block or report user

Report or block petulla

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@petulla
petulla / bert.ipynb
Created Aug 1, 2019
fastai + bert multiclassification
View bert.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View chroma_clamp.csv
We can't make this file beautiful and searchable because it's too large.
clamp,x
"0-0",0
"1-0",0
"2-0",0
"3-0",0
"4-0",0
"5-0",0
"6-0",0
"7-0",0
"8-0",0
@petulla
petulla / cccie31_1.csv
Created Jun 18, 2019
CIE 1931 2-deg xyz chromaticity coordinates
View cccie31_1.csv
wl x y z
360 0.175560 0.005294 0.819146
361 0.175483 0.005286 0.819231
362 0.175400 0.005279 0.819321
363 0.175317 0.005271 0.819412
364 0.175237 0.005263 0.819500
365 0.175161 0.005256 0.819582
366 0.175088 0.005247 0.819665
367 0.175015 0.005236 0.819749
368 0.174945 0.005226 0.819829
View temperature.json
{"X": [0.00273224, 0.005464481, 0.008196721, 0.010928962, 0.013661201999999999, 0.016393443, 0.019125683, 0.021857922999999998, 0.024590163999999998, 0.027322403999999998, 0.030054645, 0.032786885, 0.035519126, 0.038251366, 0.040983607000000005, 0.043715847, 0.046448087, 0.049180327999999995, 0.051912568, 0.054644809, 0.057377049000000006, 0.06010929, 0.06284153, 0.06557377, 0.068306011, 0.071038251, 0.07377049200000001, 0.076502732, 0.079234973, 0.081967213, 0.08469945400000001, 0.087431694, 0.090163934, 0.092896175, 0.095628415, 0.09836065599999999, 0.101092896, 0.103825137, 0.106557377, 0.10928961699999999, 0.112021858, 0.11475409800000001, 0.11748633900000001, 0.120218579, 0.12295082, 0.12568306, 0.128415301, 0.131147541, 0.133879781, 0.136612022, 0.139344262, 0.14207650300000002, 0.14480874300000002, 0.14754098400000001, 0.150273224, 0.153005464, 0.155737705, 0.158469945, 0.161202186, 0.163934426, 0.166666667, 0.169398907, 0.172131148, 0.174863388, 0.177595628, 0.18032786899999997, 0.183060109, 0.1857923
@petulla
petulla / visualisingdata.js
Last active Jan 23, 2019
Generic Promise.all + Axios scraper for fetching html content
View visualisingdata.js
const io = require('indian-ocean');
const cheerio = require('cheerio');
const axios = require('axios');
// config
const fileName = 'kirk.csv';
const selector = '.row > div > p';
// url generation
const months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
View keybase.md

Keybase proof

I hereby claim:

  • I am petulla on github.
  • I am petulla (https://keybase.io/petulla) on keybase.
  • I have a public key whose fingerprint is BCE1 0467 E0D9 C457 6ABA 0134 5ED0 0E6C 72C3 51F6

To claim this, I am signing this object:

@petulla
petulla / index.Rmd
Created May 12, 2018
R difficult pdf parser (with FWF parsing)
View index.Rmd
```
# This parser turns all the Cook 2006 midterm election rating PDFs into a single csv.
```
```{r}
library(tm)
library(data.table)
library(dplyr)
library(pdftools)
library(textreadr)
@petulla
petulla / index.js
Last active May 12, 2018
Huffpo Pollster p-queue Node scraper
View index.js
const PQueue = require('p-queue');
const got = require('got');
const fs = require('fs');
const d3 = require('d3');
const delay = require('delay');
const year1 = new RegExp('2014');
const year2 = new RegExp('2016');
const cd = new RegExp('CD');
@petulla
petulla / _scrape_2010NYT.Rmd
Last active Apr 12, 2018
NYT2010 Forecasting page R scrape Parallelized/Non-parallel Rvest scripts
View _scrape_2010NYT.Rmd
---
title: "scrape index"
output: html_document
---
```{r, message=F, warning=F}
# Scraping library
library(rvest)
#Dplyr etc
library(tidyverse)
You can’t perform that action at this time.