This is roughly the same test run in both casper and nightwatch.
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
function mapValues(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
result[key] = fn(obj[key], key); | |
return result; | |
}, {}); | |
} | |
function pick(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
if (fn(obj[key])) { |
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
const t = require("tcomb"); | |
// imstruct is a tcomb type builder that internally builds an | |
// Immutable.Record object, but applies tcomb's type system to it | |
const imstruct = require("../util/imstruct"); | |
const Person = imstruct({ | |
name: t.String, | |
age: t.Number | |
}); |
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
from logging.handlers import SysLogHandler | |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': True, | |
'formatters': { | |
'standard': { | |
'format' : "[YOUR PROJECT NAME] [%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s", | |
'datefmt' : "%d/%b/%Y %H:%M:%S" | |
}, | |
'verbose': { |
This gist outlines the change in the depth and breadth of the tasks and responsibilities of a software engineer as she continuously improves herself.
I created this to supplement a discussion in an internal slack group; then I though the rest of the world might benefit from this too.
Contributions are always welcome.
- Knowledge
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
import Raven from 'raven-js' | |
// Custom Redux-Thunk that catches errors | |
function createThunkMiddleware(extraArgument) { | |
return ({ dispatch, getState }) => next => action => | |
{ | |
if (typeof action === 'function') | |
{ | |
const result = action(dispatch, getState, extraArgument); |
I'm taking down this post. I just posted this as a side comment to explain a sentence on my latest blog post. This wasn't meant to be #1 on HN to start a huge war on functional programming... The thoughts are not well formed enough to have a huge audience. Sorry for all the people reading this. And please, don't dig through the history...
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
import r2 from '@mcro/r2' | |
import puppeteer from 'puppeteer' | |
import * as _ from 'lodash' | |
const sleep = ms => new Promise(res => setTimeout(res, ms)) | |
const onFocus = page => { | |
return page.evaluate(() => { | |
return new Promise(res => { | |
if (document.hasFocus()) { | |
res() |
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
import * as pulumi from "@pulumi/pulumi"; | |
import * as aws from "@pulumi/aws"; | |
import * as fs from "fs"; | |
const config = new pulumi.Config(); | |
const var_availability_zones = config.require("availabilityZones"); | |
const var_public_key = config.get("publicKey") || ""; | |
const aws_security_group_default = new aws.ec2.SecurityGroup("default", { | |
namePrefix: "example_sg", |
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
FROM python:3.6-slim-stretch as csvbuilder | |
# This one uses csvs-to-sqlite to compile the DB, and then uses datasette | |
# inspect to generate inspect-data.json Compiling pandas takes way too long | |
# under alpine so we use slim-stretch for this one instead. | |
RUN apt-get update && apt-get install -y python3-dev gcc | |
COPY *.csv csvs/ | |
RUN pip install csvs-to-sqlite datasette | |
RUN csvs-to-sqlite csvs/names.csv data.db -f "name" -c "legislature" -c "country" |