Skip to content

Instantly share code, notes, and snippets.

document.querySelectorAll('div[class^="B"]').forEach(el=>{ el.className = el.className.replace('Blur','')})
@zischwartz
zischwartz / trump_word_counts.csv
Last active April 7, 2019 23:02
Trump Tweet Word Counts
word count
trump 5931
great 5331
will 5309
that 4523
with 3974
have 3529
this 2831
they 2481
president 2435
@zischwartz
zischwartz / README.md
Last active August 10, 2019 22:41
Shortcut to Toggle Between Github Repo and That Repo's Github Pages

Add it as a custom search engine in Chrome by entering chrome://settings/searchEngines in the search bar and clicking "add".

For the url just write javascript: and then paste the contents of toggle_gh.js after the colon, and hit save.

Alternatively, if you'd like a button, you can just paste the javascript: ... as a "new page" in bookmarks.

@zischwartz
zischwartz / Readme.md
Last active March 17, 2020 08:00 — forked from josiahdavis/Readme.md
Responsive Multi-Line Chart (D3 V5)

Responsive Multi-Line Chart

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
body {
background-color: black;
height: 100vh;
overflow: hidden;
function get_random_emoji(){
let list = ['🌲', '⭐️', '👹', '😱', '👁', '🦀', '🐬', '🏝']
return list[Math.floor(list.length*Math.random())]
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
body {
background-color: black;
height: 100vh;
overflow: hidden;
class Game {
constructor(render_board){
this.render_board = render_board
this.data = [{row:4, col: 4, icon:'🐄' }]
this.render_board(this.data)
}
class Game {
constructor(render_board){
this.render_board = render_board
this.data = []
for (var row = 0; row < 10; row++) {
for (var col = 0; col < 10; col++) {
let icon = col < 5 ? '☀️': '🌵'
this.data.push({row, col, icon})
}
}
// XXX YOU ARE NOT MEANT TO EDIT THIS FILE
// XXX YOU ARE NOT MEANT TO EDIT THIS FILE
// XXX YOU ARE NOT MEANT TO EDIT THIS FILE
let key_func = function(d){ return d.id }
// https://bost.ocks.org/mike/chart/
// XXX meant to be used with datum(), not data()
// i.e. selection should just be a single g