Skip to content

Instantly share code, notes, and snippets.

Avatar

Albert Sun albertsun

View GitHub Profile
View 2017-obituaries.tsv
Month Day URL
1 1 http://www.nytimes.com/2017/01/01/arts/michel-deon-novelist-who-tapped-the-french-experience-dies-at-97.html
1 1 http://www.nytimes.com/2017/01/01/arts/television/william-christopher-father-mulcahy-on-mash-dies-at-84.html
1 1 http://www.nytimes.com/2017/01/01/us/huston-smith-author-of-the-worlds-religions-dies-at-97.html
1 2 http://www.nytimes.com/2017/01/02/books/joyce-appleby-historian-of-capitalism-and-american-identity-is-dead-at-87.html
1 2 http://www.nytimes.com/2017/01/02/arts/design/john-berger-provocative-art-critic-dies-at-90.html
1 2 http://www.nytimes.com/2017/01/02/world/middleeast/hilarion-capucci-archbishop-jailed-for-aiding-palestinian-militants-dies-at-94.html
1 3 http://www.nytimes.com/2017/01/03/business/anthony-b-atkinson-economist-who-pioneered-study-of-inequality-dies-at-72.html
1 3 http://www.nytimes.com/2017/01/03/sports/skiing/jean-vuarnet-a-downhill-skiing-innovator-dies-at-83.html
1 4 http://www.nytimes.com/2017/01/04/us/sister-frances-ann-carr-one-of-the-last-thre
View .gitconfig
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
lol = log --graph --decorate --pretty=oneline --abbrev-commit --all
dfb = log --left-right --graph --cherry-pick --oneline
View rss-full-text-scrape-to-stevedore.json
{
"schema_version": 1,
"name": "RSS Full Text Scrape to Stevedore",
"description": "Follows an RSS feed and visits every feed item to save the full text into Stevedore",
"source_url": "https://mighty-retreat-48764.herokuapp.com/scenarios/7/export",
"guid": "1dcba6751110ed460f0a83273953535e",
"tag_fg_color": "#ffffff",
"tag_bg_color": "#5bc0de",
"exported_at": "2016-04-18T22:41:41Z",
"agents": [
View terraform apply
terraform apply .tfplan
aws_instance.k8s-prd-worker-b.0: Creating...
ami: "" => "ami-1a642670"
availability_zone: "" => "<computed>"
ebs_block_device.#: "" => "<computed>"
ephemeral_block_device.#: "" => "<computed>"
instance_state: "" => "<computed>"
instance_type: "" => "m4.2xlarge"
key_name: "" => "everything"
placement_group: "" => "<computed>"
View fixiekill
javascript:(function(){for(var a=document.querySelectorAll("*"),i=0,e;e=a[i];i++)"fixed"==getComputedStyle(e).position&&(e.style.position="static");}());
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.bar {
fill: steelblue;
}
.bar:hover {
fill: brown;
@albertsun
albertsun / circle-segment.js
Created January 29, 2015 18:18
Drawing partial circles with area proportional to a value (good!) or angle proportional to a value (misleading!)
View circle-segment.js
(function() {
var circleSegment = {};
var degreesToRadians = function(deg) {
return deg*Math.PI*2/360;
};
// takes an angle in radians
// returns 0-1 the proportion of a circle's area
// that a segment bounded by arc of that angle fills
View keybase.md

Keybase proof

I hereby claim:

  • I am albertsun on github.
  • I am albertsun (https://keybase.io/albertsun) on keybase.
  • I have a public key whose fingerprint is 9ADB 59B4 410D 33AE DC9B 21D2 E969 C37F 7850 A4AF

To claim this, I am signing this object:

@albertsun
albertsun / sat.md
Last active August 29, 2015 13:59
If SAT questions can't interpret charts correctly, what hope do the rest of us have?
View sat.md

If SAT questions can't interpret charts correctly, what hope do the rest of us have?

Chart

New SAT Sample questions. Chart and story originally from The Atlantic

See anything wrong with this SAT test question?

There's no correct answer! The question writer seems to want C to be the correct answer but that's a sloppy, too fast and imprecise interpretation of the chart.

@albertsun
albertsun / killstickies.js
Created January 14, 2014 18:57
Save this snippet of javascript as a bookmarklet to kill any fixed top or sidebars on a web page.
View killstickies.js
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.firstElementChild.appendChild(c)}})(window,document,"1.10.2",function($,L){$('*').filter(function(){return%20$(this).css("position")==='fixed';}).remove();});