Skip to content

Instantly share code, notes, and snippets.

David Guttman davidguttman

Block or report user

Report or block davidguttman

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
@davidguttman
davidguttman / split-unspaced-text.js
Created Apr 26, 2016
Split text without spaces into list of words
View split-unspaced-text.js
// port of http://stackoverflow.com/questions/8870261/how-to-split-text-without-spaces-into-list-of-words
var _ = require('lodash')
var fs = require('fs')
var tape = require('tape')
var dictStr = fs.readFileSync(__dirname + '/dump/words-by-freq.txt', 'utf8')
var wordsByFreq = dictStr.split('\n')
var maxWord = 0
@davidguttman
davidguttman / key.md
Created Mar 3, 2019 — forked from shobotch/key.md
Twitter (un)official Consumer Key
View key.md

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN
Consumer key:    IQKbtAYlXLripLGPWd0HUA
View .slate.js
slate.config('defaultToCurrentScreen', true)
slate.bind('up:cmd;ctrl;alt', screenify(topCenter))
slate.bind('down:cmd;ctrl;alt', screenify(bottomCenter))
slate.bind('left:ctrl;alt;shift', screenify(topLeft))
slate.bind('up:ctrl;alt;shift', screenify(topRight))
slate.bind('right:ctrl;alt;shift', screenify(bottomRight))
slate.bind('down:ctrl;alt;shift', screenify(bottomLeft))
slate.bind('left:cmd;ctrl;alt', screenify(left))
@davidguttman
davidguttman / index.js
Last active Aug 29, 2018
Bootstrap and Browserify
View index.js
// Bootstrap wants jQuery global =(
window.jQuery = $ = require('jquery')
// Bootstrap doesn't have a "main" field / export anything =(
var bootstrap = require('bootstrap/dist/js/bootstrap')
// Get Bootstrap styles with cssify
var style = require('./node_modules/bootstrap/dist/css/bootstrap.css')
var popover = document.createElement('span')
popover.innerHTML = 'I have a popover'
View top-tokens.json
[
{
"rank": "1",
"name": "EOS",
"platform": "Ethereum",
"cap": "$6,103,736,922",
"price": "$6.81",
"volume": "$562,160,000",
"supply": "896,149,492"
},
View top-coins.json
[
{
"rank": "1",
"name": "Bitcoin",
"cap": "$106,248,736,115",
"price": "$6,196.82",
"volume": "$3,601,760,000",
"supply": "17,145,687 BTC"
},
{
@davidguttman
davidguttman / make-dinner-bottom.js
Last active Jun 11, 2018
Top vs Bottom Exports
View make-dinner-bottom.js
function boilPotatoes () {}
function mashPotatoes () {}
function cookTurkey () {}
function carveTurkey () {}
function preparePotatoes () {
boilPotatoes()
@davidguttman
davidguttman / index.js
Created Jul 19, 2017
requirebin sketch
View index.js
var Color = require('color')
var Isomer = require('isomer')
var Simplex = require('perlin-simplex')
var Point = Isomer.Point
var Shape = Isomer.Shape
var simplex = new Simplex()
var baseColor = Color('#0096B0')
@davidguttman
davidguttman / index.js
Created Jul 17, 2017
requirebin sketch
View index.js
var Color = require('color')
var Isomer = require('isomer')
var Point = Isomer.Point
var Shape = Isomer.Shape
var cPink = Color('#ff0177')
cPink = cPink.darken(0.2)
document.body.style.background = '#222'
@davidguttman
davidguttman / index.js
Created May 22, 2017
requirebin sketch
View index.js
var Simplex = require('perlin-simplex')
var Delaunator = require('delaunator')
var getDistance = require('euclidean-distance')
var simplex = new Simplex()
var SPEED = 0.001
var N_POINTS = 200
document.body.style.background = 'rgb(20, 20, 20)'
You can’t perform that action at this time.