import until from 'path/to/until'
import { shallow } from 'enzyme'
const EnhancedFoo = compose(
connect(...),
withHandlers(...),
withContext(...)
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
// routes.js | |
const routes = [ | |
{ | |
path: '/', | |
component: Home, | |
exact: true | |
}, | |
{ | |
path: '/gists', | |
component: Gists |
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
// | |
// Arrow for fabric.js | |
// | |
(function($){ | |
$.Arrow = $.util.createClass($.Line, $.Observable, { | |
initialize: function(e,t) { | |
this.callSuper("initialize", e, t) | |
this.set({type:'arrow'}); | |
}, | |
_render: function(e) { |
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
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012 | |
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler" | |
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist | |
(function(host) { | |
function Crawler() { | |
this.visitedURLs = {}; | |
}; | |
While tests run in source order, surrounding code does not which can lead to hard to debug issues.
Compare the test file below with the sample output below that and note the order of the log messages.
- Any code not inside of
it
,beforeAll
,afterAll
,beforeEach
orafterEach
runs immediately on initialisation. - This means code at the end of your file runs before even your before hooks.
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
# Put this function to your .bashrc file. | |
# Usage: mv oldfilename | |
# If you call mv without the second parameter it will prompt you to edit the filename on command line. | |
# Original mv is called when it's called with more than one argument. | |
# It's useful when you want to change just a few letters in a long name. | |
# | |
# Also see: | |
# - imv from renameutils | |
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste) |
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
OlderNewer