I'd like my impact on the world to be socially meaningful while simultaneously leveraging technology. There are a lot of social issues to which technology isn't the immediate solution: a mobile app isn't going to cure racism or poverty. Inversely, there's a lot of technology that isn't aimed at solving anything of social importance (a lot of which I'm an avid consumer of). There does exist a sweet spot where technology and social good do intersect (even if unintentional). I'm thinking of Periscope bringing instant awareness to police brutality. I'm thinking of Uber ensuring that getting a ride somewhere isn't harder based on the color of your skin. I'm thinking of computers/smartphones/etc decreasing paper wastage by orders of magnitude. It's a difficult goal, especially when aiming for the social impact to be a natural byproduct rather than a contrived attempt at charity; being a "byproduct" eliminates any procedural approach to ach
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const fs = require('fs'); | |
const path = require('path'); | |
const async = require('async'); | |
const getUserFromMessage = (messageObject, userList) => { | |
const relevantUser = userList.filter(user => { | |
return (user.id == messageObject.user); | |
})[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const obviousWords = ["a", "able", "about", "across", "after", "all", "almost", "also", "am", "among", "an", "and", "any", "are", "as", "at", "be", "because", "been", "but", "by", "can", "cannot", "could", "dear", "did", "do", "does", "either", "else", "ever", "every", "for", "from", "get", "got", "had", "has", "have", "he", "her", "hers", "him", "his", "how", "however", "i", "if", "in", "into", "is", "it", "its", "just", "least", "let", "like", "likely", "may", "me", "might", "most", "must", "my", "neither", "no", "nor", "not", "of", "off", "often", "on", "only", "or", "other", "our", "own", "rather", "said", "say", "says", "she", "should", "since", "so", "some", "than", "that", "the", "their", "them", "then", "there", "these", "they", "this", "tis", "to", "too", "twas", "us", "wants", "was", "we", "were", "what", "when", "where", "which", "while", "who", "whom", "why", "will", "with", "would", "yet", "you", "your", "ain't", "aren't", "can't", "could've", "couldn't", "didn't", "doesn't", "don' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LocalStore { | |
constructor(storeName) { | |
this.storeName = storeName; | |
localStorage[storeName] = JSON.stringify([]); | |
} | |
getAll() { | |
return JSON.parse( | |
localStorage[this.storeName] | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is what I ran in the console of the browser to scrape the data: | |
function tableToJson(table) { | |
var data = []; | |
// first row needs to be headers | |
var headers = []; | |
for (var i=0; i<table.rows[0].cells.length; i++) { | |
headers[i] = table.rows[0].cells[i].innerHTML.toLowerCase().replace(/ /gi,''); | |
} | |
// go through cells |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"lower": "250,000.01", | |
"upper": "251,000.00", | |
"sale": "1,655.00" | |
}, | |
{ | |
"lower": "251,000.01", | |
"upper": "252,000.00", | |
"sale": "1,660.00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function getRegistrants() { | |
NodeList.prototype.forEach = Array.prototype.forEach; | |
registrants = 0; | |
document.querySelectorAll('.registrants .number').forEach(function(d) { | |
registrants += Number(d.innerHTML) | |
}); | |
return registrants; | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Usage: | |
* var html = '<!DOCTYPE html><html><head></head><body></body></html>'; | |
* var htmlDocument = html.toHTML(); | |
* HTMLDocument.prototype.isPrototypeOf(htmlDocument) => returns true | |
*/ | |
String.prototype.toHTML = (function() { | |
function toHTML(str) { | |
var dom = new DOMParser(); | |
var doc = dom.parseFromString(str, 'text/html'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var csv2json = (function() { | |
function convert(data) { | |
var json = []; | |
var d = data.split('\n'); | |
var keys = d[0].split(','); | |
d = d.splice(1); | |
d.forEach(function(data) { | |
var keyVal = data.split(','); | |
var obj = {}; | |
keys.forEach(function(keyData, n) { |
NewerOlder