import until from 'path/to/until'
import { shallow } from 'enzyme'
const EnhancedFoo = compose(
connect(...),
withHandlers(...),
withContext(...)
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 hidden or 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
license: gpl-3.0 |
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
This file contains hidden or 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 hidden or 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
CREATE OR REPLACE FUNCTION compute_5min_rollups(start_time TIMESTAMP, end_time TIMESTAMP) | |
RETURNS void LANGUAGE PLPGSQL AS $function$ | |
BEGIN | |
EXECUTE $$ | |
INSERT INTO rollups_5min | |
SELECT | |
date_trunc('seconds', (timestamp - TIMESTAMP 'epoch') / 300) * 300 + TIMESTAMP 'epoch' AS minute, | |
app_id, | |
timestamp, | |
count(*) AS query_count, |
This file contains hidden or 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) |
This file contains hidden or 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
function ColorEvents() { | |
var today = new Date(); | |
var nextweek = new Date(); | |
nextweek.setDate(nextweek.getDate() + 14); | |
var calendars = CalendarApp.getAllOwnedCalendars(); | |
for (var i=0; i<calendars.length; i++) { | |
var calendar = calendars[i]; |
OlderNewer