Skip to content

Instantly share code, notes, and snippets.

@cburgmer
cburgmer / htmlparser.js
Created June 5, 2012 20:46
John Resig's JavasScript HTML parser with bug fixes for parsing <script> & <style>
/*
* HTML Parser By John Resig (ejohn.org)
* Original code by Erik Arvidsson, Mozilla Public License
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
*
* // Use like so:
* HTMLParser(htmlString, {
* start: function(tag, attrs, unary) {},
* end: function(tag) {},
* chars: function(text) {},
@abackstrom
abackstrom / Makefile
Created November 2, 2010 09:45
CSS and JavaScript Minification/Compression Makefile
#
# css/js minification/compression makefile
#
#
# JS_TARGETS -- js files to minify/gzip
# CSS_TARGETS -- css files to minify/gzip
# CLEANUP -- additional files to delete during "make clean"
#
@philipz
philipz / gist:67892bdc8a385ecb3b8c
Last active November 14, 2017 22:57
Rsync & Docker save

Rsync & Docker save

docker save $1 > $1.tar && rsync -ravP -e ssh $1.tar philipz@192.168.2.51:/home/philipz/tmp && rm $1.tar ##Add Gzip docker save busybox | gzip -c - > busybox.tar.gz

gzip -d busybox.tar.gz && docker load < busybox.tar

docker save busybox | gzip | pv | ssh -i ~/.ssh/id_rsa USER@HOSTNAME sudo docker load

@matthewmueller
matthewmueller / index.html
Last active January 11, 2018 09:41
HTML Starter Template for rock-solid Web Apps
<!--
What?
HTML Starter Template for rock-solid Web Apps
Where?
Get the latest template here: https://gist.github.com/matthewmueller/cb33e2c5f6834511cd45f17b59271052

DraftJS Preact Demo

Start

npm install

npm start

Go to localhost:8080

@tj
tj / snippets.coffee
Last active September 1, 2018 19:01
Atom snippets for Go
'.source.go':
'Options':
'prefix': 'options'
'body': '''
// Option function.
type Option func(*$1)
// New with the given options.
func New(options ...Option) *$1 {
@miguelmota
miguelmota / timestamp_to_unix.sql
Created May 2, 2019 05:24
PostgreSQL timestamp datetime to unix timestamp integer
-- assuming created_at is timestamp column
extract(epoch from created_at)::numeric::integer
@mattdesl
mattdesl / about.md
Last active August 9, 2019 13:21
fast & optimized browserify builds

Small script for development + builds with browserify.

Uses loose-envify for faster inlining and cross-env to handle windows/unix shells.

Dev features:

  • fast rebuilds w/ watchify, LiveReload, syntax errors in DOM, etc.

Build features:

  • uglify, simple dead code elimination, optimized bundle.
@wesbos
wesbos / gulpfile.js
Last active October 21, 2019 19:38
FAST Browserify + Reactify + Babelify
// Update: Hey Folks - I've got a full Gulpfile with everything else over at https://github.com/wesbos/React-For-Beginners-Starter-Files
var source = require('vinyl-source-stream');
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('browserify');
var reactify = require('reactify');
var babelify = require('babelify');
var watchify = require('watchify');
var notify = require('gulp-notify');
@bomberstudios
bomberstudios / sketch-diff-in-git.md
Last active November 8, 2019 17:58
How to diff your .sketch files in Git

Using sketchtool to diff your .sketch files using text

Requirements

You need to have SketchTool installed somewhere in your path.

Setup

Add this in your ~/.gitconfig file (for some reason, it won't work in a local .gitconfig file):