Skip to content

Instantly share code, notes, and snippets.

Zach Schwartz zischwartz

Block or report user

Report or block zischwartz

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
@zischwartz
zischwartz / trump_word_counts.csv
Last active Apr 7, 2019
Trump Tweet Word Counts
View trump_word_counts.csv
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 Aug 10, 2019
Shortcut to Toggle Between Github Repo and That Repo's Github Pages
View README.md

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 Nov 2, 2018 — forked from josiahdavis/Readme.md
Responsive Multi-Line Chart (D3 V5)
View Readme.md

Responsive Multi-Line Chart

View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
body {
background-color: black;
height: 100vh;
overflow: hidden;
View rando.js
function get_random_emoji(){
let list = ['🌲', '⭐️', '👹', '😱', '👁', '🦀', '🐬', '🏝']
return list[Math.floor(list.length*Math.random())]
}
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
body {
background-color: black;
height: 100vh;
overflow: hidden;
View game.js
class Game {
constructor(render_board){
this.render_board = render_board
this.data = [{row:4, col: 4, icon:'🐄' }]
this.render_board(this.data)
}
View game.js
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})
}
}
View board.js
// 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
View board.js
// 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
You can’t perform that action at this time.