Skip to content

Instantly share code, notes, and snippets.

@ahutchings
ahutchings / redux-orm.js
Last active November 20, 2017 19:56
Flow library definition for redux-orm
declare module 'redux-orm' {
/**
* The heart of an ORM, the data model.
*
* The fields you specify to the Model will be used to generate
* a schema to the database, related property accessors, and
* possibly through models.
*
* In each {@link Session} you instantiate from an {@link ORM} instance,
* you will receive a session-specific subclass of this Model. The methods
@sindresorhus
sindresorhus / np.sh
Last active December 11, 2022 21:26
shell function for publishing node modules with some goodies
# npm publish with goodies
# prerequisite: `npm install -g trash`
# `np` with an optional argument `patch`/`minor`/`major`/`<version>`
# defaults to `patch`
np() {
trash node_modules &>/dev/null;
git pull --rebase &&
npm install &&
npm test &&
npm version ${1:-patch} &&
@paulirish
paulirish / gist:854293
Created March 4, 2011 07:18
jQuery unserialize Form plugin
// Unserialize (to) form plugin - by Christopher Thielen
// adapted and desuckified (a little) by Paul Irish
// takes a GET-serialized string, e.g. first=5&second=3&a=b and sets input tags (e.g. input name="first") to their values (e.g. 5)
(function($) {
$.fn.unserializeForm = function(values) {
@groves
groves / add_to_itunes.py
Created November 20, 2010 23:41
Transcodes shows downloaded with sickbeard into a format usable on iOS and AppleTV with HandBrakeCLI and fills in their metadata with AtomicParsley
#!/usr/bin/env python
import os, re, subprocess, sys
from xml.etree import ElementTree
retag = sys.argv[1] == "retag"
if retag:
del sys.argv[1]
source = os.path.abspath(sys.argv[1])
extensionless = '.'.join(source.split('.')[:-1])
@shadowhand
shadowhand / install-kohana.sh
Created November 8, 2010 06:29
A script to install the Kohana PHP Framework
#!/bin/sh
# have submodules been added?
MODS=0
# Github base URL
GITHUB="https://github.com"
# Default branch
DEFAULT_BRANCH="3.0/master"