Skip to content

Instantly share code, notes, and snippets.

View captbaritone's full-sized avatar
💭
-=[ Dorkin' Out ]=-

Jordan Eldredge captbaritone

💭
-=[ Dorkin' Out ]=-
View GitHub Profile
<html>
<body>
<script>function test(a, b) {};</script>
<script src='https://unpkg.com/underscore@1.8.3/underscore.js'></script>
<script> console.log("1.8.3 result: ", _.bind(test, {}).length); // 2 </script>
<script src='https://unpkg.com/underscore@1.9.0/underscore.js'></script>
@captbaritone
captbaritone / crash_safari.html
Created August 16, 2017 04:15
Crash Safari
<script>
var context = new (window.AudioContext || window.webkitAudioContext)();
function start () {
var source = context.createOscillator();
var chanMerge = context.createChannelMerger(2);
var filter = context.createBiquadFilter();
source.connect(chanMerge, 0, 0);
source.connect(chanMerge, 0, 1);
Process: com.apple.WebKit.WebContent [15802]
Path: /System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent
Identifier: com.apple.WebKit.WebContent
Version: 12603 (12603.1.30.0.34)
Build Info: WebKit2-7603001030000034~4
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Safari [15728]
User ID: 502
2017-04-10 03:18:26 localhost rotate_backups.cli[32443] INFO Performing a dry run (because of --dry-run option) ..
2017-04-10 03:18:26 localhost rotate_backups[32443] INFO Scanning /home/vim/dumps for backups ..
2017-04-10 03:18:26 localhost rotate_backups[32443] INFO Found 979 timestamped backups in /home/vim/dumps.
2017-04-10 03:18:26 localhost rotate_backups[32443] INFO Preserving ~/dumps/rethinkdb_dump_2014-06-27T05:53:50.tar.gz (matches 'yearly' retention period) ..
2017-04-10 03:18:26 localhost rotate_backups[32443] INFO Deleting ~/dumps/rethinkdb_dump_2014-06-27T17:49:04.tar.gz ..
2017-04-10 03:18:26 localhost rotate_backups[32443] INFO Deleting ~/dumps/rethinkdb_dump_2014-06-27T21:00:14.tar.gz ..
2017-04-10 03:18:26 localhost rotate_backups[32443] INFO Deleting ~/dumps/rethinkdb_dump_2014-06-29T17:50:44.tar.gz ..
2017-04-10 03:18:26 localhost rotate_backups[32443] INFO Deleting ~/dumps/rethinkdb_dump_2014-07-02T07:52:04.tar.gz ..
2017-04-10 03:18:26 localhost rotate_backups[32443] INFO Deleting ~/dump
pip-compile -v requirements.in
Using indexes:
https://pypi.python.org/simple
ROUND 1
Current constraints:
configparser==3.5.0b2
Flask
Flask-Cache==0.12
html5lib==1.0b1
@captbaritone
captbaritone / index.html
Created March 24, 2017 18:18
Crash Safari (Mac OS & iOS)
<script>
var context = new (window.AudioContext || window.webkitAudioContext)();
var chanSplit = context.createChannelSplitter(2);
var leftGain = context.createGain();
var rightGain = context.createGain();
var chanMerge = context.createChannelMerger(2);
var filter = context.createBiquadFilter();
chanSplit.connect(leftGain, 0);

Testing React+Redux code

Test "connected" React components

When testing React components which have been connected to a Redux store via react-redux's connect(), you can pass your store directly to the wrapped component like so:

it('renders a "happy path" state to snapshot', () =&gt; {

Testing React+Redux code

Test "connected" React components

When testing React components which have been connected to a Redux store via react-redux's connect(), you can pass your store directly to the wrapped component like so:

it('renders a "happy path" state to snapshot', () =&gt; {
<script>
var context = new (window.AudioContext || window.webkitAudioContext)();
var chanSplit = context.createChannelSplitter(2);
var leftGain = context.createGain();
var rightGain = context.createGain();
var chanMerge = context.createChannelMerger(2);
var filter = context.createBiquadFilter();
chanSplit.connect(leftGain, 0);

React Component

The heart of a Hearsay component is a React component. The props (state) passed into the React component can be completely decoupled from

propTypes

Since components are used in many projects, it's very useful to have them explicitly define the "contract" that they implement. IE, what inputs they