Skip to content

Instantly share code, notes, and snippets.

@weisjohn
weisjohn / keybase.md
Created April 21, 2018 03:10
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 19:42
froala color beautified
/*!
* 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)
# 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 March 23, 2017 21:37
notes for Frontend Masters - Complete Intro to React v2 - March 27th, 2017

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 March 13, 2017 04:20
notes for Frontend Masters - Complete Intro to React v2 - March 13th, 2017
@weisjohn
weisjohn / fake-age-bins.js
Created December 23, 2016 21:17
fake age range numbers via gaussian distribution
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 August 11, 2016 18:53
node es6 cors https proxy
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
// 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 February 26, 2015 22:47
node-hid-install-troubles
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 September 10, 2014 22:04
test your contacts against the gmail password compilation
#!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