Skip to content

Instantly share code, notes, and snippets.

@typpo
typpo / gist:abc09519d8c7939ebc30762edd80e654
Last active January 8, 2017 23:57 — forked from mmcgahan/gist:9fa045d98c7c122f1c0b
Handlebars template inheritance - with a bug fix (see handlebars.loadPartial)
# Template composition with inclusion
Every template language I have seen provides some mechanism for one template to include another, thus supporting the reuse of repeated elements like headers and footers. The included templates are called partials in Mustache parlance:
```html
<!-- home.hbs -->
<html>
<body>
{{> header}}
<p> HOME </p>
{{> footer}}
@typpo
typpo / neural-style-ec2.txt
Created June 4, 2016 19:38 — forked from elad/neural-style-ec2.txt
Running neural-style in EC2
Start a g2.2xlarge or better (GPU instance) with https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LaunchInstanceWizard:ami=ami-ffba7b94
Login, username is ubuntu
Update a bunch of stuff and make sure cudnn R2 is used:
luarocks install image
luarocks install loadcaffe
luarocks install torch
export LD_LIBRARY_PATH=/home/ubuntu/torch-distro/install/lib:/home/ubuntu/torch-distro/install/lib:/home/ubuntu/cudnn-6.5-linux-x64-v2-rc2
@typpo
typpo / tree.md
Created March 11, 2014 03:58 — forked from hrldcpr/tree.md

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@typpo
typpo / sqlite2pg.sh
Last active July 31, 2019 14:20 — forked from eclubb/sqlite2pg.sh
#!/bin/sh
# This script will migrate schema and data from a SQLite3 database to PostgreSQL.
# Schema translation based on http://stackoverflow.com/a/4581921/1303625.
# Some column types are not handled (e.g blobs).
if [ $# -lt 3 ]; then
echo "usage: sqlite2pg.sh sqlite_db_path pg_db_name pg_user_name";
exit 1
fi
This file has been truncated, but you can view the full file.
'use strict';
var COMPILED = !0, goog = goog || {};
goog.global = this;
goog.DEBUG = !1;
goog.LOCALE = "en";
goog.provide = function (a) {
if (!COMPILED) {
if (goog.isProvided_(a))
throw Error('Namespace "' + a + '" already declared.');
delete goog.implicitNamespaces_[a];
@typpo
typpo / tree.md
Created April 23, 2012 22:30 — forked from hrldcpr/tree.md
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!