Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am weisjohn on github.
  • I am weisjohn (https://keybase.io/weisjohn) on keybase.
  • I have a public key whose fingerprint is 0D82 1A64 9177 3831 5AD6 A57A 5013 D03D 7310 E3E2

To claim this, I am signing this object:

@weisjohn
weisjohn / colors.unmin.js
Created May 23, 2017
froala color beautified
View colors.unmin.js
/*!
* froala_editor v2.6.1 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2017 Froala Labs
*/
! function(a) {
"function" == typeof define && define.amd ? define(["jquery"], a) : "object" == typeof module && module.exports ? module.exports = function(b, c) {
return void 0 === c && (c = "undefined" != typeof window ? require("jquery") : require("jquery")(b)), a(c)
} : a(window.jQuery)
View notes for Frontend Masters - Complete Intro to React v2 - March 20th, 2017
# Frontend Masters - Complete Intro to React v2 - March 20th, 2017
## JSX
- SoC smashed together
- `{}` - output the value of this js expression
- `webpack --watch`
- `npm run-script foo -- ` then after `--` is sent to command
## JSX vs. createElement
@weisjohn
weisjohn / fem-react-2017.03.27.md
Created Mar 23, 2017
notes for Frontend Masters - Complete Intro to React v2 - March 27th, 2017
View fem-react-2017.03.27.md

Frontend Masters - Complete Intro to React v2 - March 27th, 2017

Routing in React

  • react-router@v4-alpha

HashRouter Configuration

  • HashRouter - higher-order component
  • Match elements with a component passed in via prop
@weisjohn
weisjohn / fem-react-2017.03.13.md
Created Mar 13, 2017
notes for Frontend Masters - Complete Intro to React v2 - March 13th, 2017
View fem-react-2017.03.13.md
@weisjohn
weisjohn / fake-age-bins.js
Created Dec 23, 2016
fake age range numbers via gaussian distribution
View fake-age-bins.js
var gaussian = require('gaussian');
// mean is the center of the distritubion
var mean = 34.5;
var variance = 300;
var distribution = gaussian(mean, variance);
// number of samples
@weisjohn
weisjohn / cors-https-proxy.js
Created Aug 11, 2016
node es6 cors https proxy
View cors-https-proxy.js
const http = require('http');
const https = require('https');
const server = http.createServer();
const host = 'example.com';
server.on('request', (req, res) => {
// set cors on the response
View chirps.js
// configure twitter integration
var twit = require('twit');
var T = new Twit({
consumer_key: '...'
, consumer_secret: '...'
, access_token: '...'
, access_token_secret: '...'
});
// express app
@weisjohn
weisjohn / gist:701c0b6fecfa8df870b4
Created Feb 26, 2015
node-hid-install-troubles
View gist:701c0b6fecfa8df870b4
0 info it worked if it ends with ok
1 verbose cli [ '/Users/jweis/.nvm/v0.12.0/bin/node',
1 verbose cli '/Users/jweis/.nvm/v0.12.0/bin/npm',
1 verbose cli 'install' ]
2 info using npm@2.5.1
3 info using node@v0.12.0
4 verbose install where, deps [ '/Users/jweis/mysrc/weisjohn/nes-controller', [ 'node-hid' ] ]
5 verbose install where, peers [ '/Users/jweis/mysrc/weisjohn/nes-controller', [] ]
6 info preinstall nes-controller@0.1.0
7 silly cache add args [ 'node-hid@~0.3.2', null ]
@weisjohn
weisjohn / gmail-test.sh
Created Sep 10, 2014
test your contacts against the gmail password compilation
View gmail-test.sh
#!bin/bash
echo "Export your Gmail contacts as a CSV, name it contacts.csv, put it in this directory, press Enter"
read foo
wget --referer=https://forum.btcsec.com https://forum.btcsec.com/uploads/manual_09_2014/google_5000000.7z
echo "I haven't worked out a way to unzip .7z files from a cli yet... patches welcome"
echo "Press enter when you've unzipped the file"
read foo
You can’t perform that action at this time.