Skip to content

Instantly share code, notes, and snippets.

module.exports = {
devtool: 'cheap-module-source-map', // might want to change this `source-map` for prod builds
entry: './entry',
output: {
path: './build',
pathinfo: true,
filename: 'bundle.js',
},
resolve: {
// These are the reasonable defaults supported by the Node ecosystem.
#!/usr/bin/env python
import glob
import os
import sys
os.environ['PYFLAKES_NODOCTEST'] = '1'
# pep8.py uses sys.argv to find setup.cfg
sys.argv = [os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)]
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`

Requirements

~> brew install ffmpeg
~> brew install imagemagick

Usage

@jkimbo
jkimbo / js-testing-tips.md
Created October 25, 2015 22:31
JS testing tips

Sinon

Matching against an object

If you need to assert calledWith an object you can use sinon.match. This roughly matches against the object so you don't have to pass the full object.

assert(dispatchSpy.calledWith(sinon.match({
  payload: {
 'foo': 'bar',
<Responsive>
    {(width, orientation) => {
        if (width > 851) {
            if (orientation === 'portait') {
                return (
                    <div>Big and vertical</div>
                );
            }
 return (
@jkimbo
jkimbo / 1-neo4j-ramdisk.md
Last active August 29, 2015 14:22
neo4j ramdisk
  • Create a ramdisk using make_neo4j_ramdisk
  • Clone https://github.com/nigelsmall/neoram
  • Repoint symlink in neoram to /Volumes/neo4jramdisk/neoram
  • Run ./neoram download to download neo4j
  • Open ./opt/neo4j/conf/neo4j-server.properties and change org.neo4j.server.webserver.port=7474 to something that won't conflict
  • Install the load2neo plugin
    • Download the plugin and move the .jar files to ./opt/neo4j/plugins
    • Add org.neo4j.server.thirdparty_jaxrs_classes=com.nigelsmall.load2neo=/load2neo to ./opt/neo4j/conf/neo4j-server.properties
  • Run ./neoram start
@jkimbo
jkimbo / table-sizes.sql
Created June 1, 2015 14:07
MySQL DB Table sizes
SELECT CONCAT(table_schema, '.', TABLE_NAME),
CONCAT(ROUND(table_rows / 1000, 2), 'K') ROWS,
CONCAT(ROUND(data_length / ( 1024 * 1024 ), 2), 'M') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 ), 2), 'M') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 ), 2), 'M') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC;
@jkimbo
jkimbo / 0-url-helper.md
Last active August 29, 2015 14:20
Django javascript url helper

Pass the urls you care about to your javascript:

return {
  'urls': js_urls(
    'foo',   # 'foo' => r'^(?P<slug>[a-z0-9-]+)/'
    'bar',   # 'bar' => r'^bar/(?P<id>[0-9-]+)/'
  ),
}