Skip to content

Instantly share code, notes, and snippets.

View wamatt's full-sized avatar

Matt Tagg wamatt

  • Palo Alto, California
View GitHub Profile
@sindre
sindre / gist:962201
Created May 9, 2011 07:37
JS createDocumentFragment to avoid reflow
// http://www.slideshare.net/nzakas/high-performance-javascript-amazon-devcon-2011
var list = document.getElementsByClassName('items')[0],
fragment = document.createDocumentFragment(),
i, item;
for (i=0; i < 10; i++) {
item = document.createElement('li');
item.innerHTML = 'item #'+i;
fragment.appenChild(item);
}
@hidsh
hidsh / g
Created April 10, 2013 11:00
Yet Another Alternative to 'grep find' using mdfind(a.k.a. Spotlight) on Mac OS X
#!/bin/sh
#
# g - Yet Another Alternative to 'grep find' using mdfind(a.k.a. Spotlight) on Mac OS X
#
# usage:
# $g hoge
# $g hoge dir
USAGE="usage:\n\
\$g hoge\n\
@jdarling
jdarling / Object.observe.poly.js
Created November 30, 2012 02:00
Initial Object.observe polyfill/shim trying to be compliant
/*
Migrated to: https://github.com/jdarling/Object.observe
Tested against Chromium build with Object.observe and acts EXACTLY the same,
though Chromium build is MUCH faster
Trying to stay as close to the spec as possible,
this is a work in progress, feel free to comment/update
http://wiki.ecmascript.org/doku.php?id=harmony:observe
#!/bin/sh -x ## or just ` curl -Ls http://git.io/vRozn | sh `.
## Downloads the Mac OS X 10.10 Recovery Partition update,
## Copy's over the 10.10 version of Disk Utility.app, then
## use git to apply a binary patch so it will run on 10.11+.
cd /tmp
rm -rf DU1010
mkdir DU1010
@gavinandresen
gavinandresen / btcpayments.rst
Last active March 28, 2021 06:40
Bitcoin Payment Messages

SEE BIP 70

See https://en.bitcoin.it/wiki/BIP_0070 for the latest version of this document; I'll keep this document so the process of discussion/revision isn't lost.

Bitcoin Payment Messages

This document proposes protocol buffer-based formats for a simple payment protocol between a customer's bitcoin client software and a merchant.

/* global Application, ObjC, $ */
/**
* repozish.js
*
* this is an example of using os x yosemite's "JavaScript for Automation":
*
* https://developer.apple.com/library/prerelease/mac/releasenotes/interapplicationcommunication/rn-javascriptforautomation/index.html
*
* it repositions some windows based on some position settings. you can run
@Watson1978
Watson1978 / macruby_uninstall
Created February 27, 2012 23:43
MacRuby : uninstaller
#!/bin/bash
# MacRuby
rm -rf /Library/Frameworks/MacRuby.framework
XCODE_DIR=`xcode-select -print-path`
# tool
rm -f "$XCODE_DIR"/usr/bin/rb_nibtool
rm -f "$XCODE_DIR"/Tools/rb_nibtool
@wolever
wolever / profile
Created September 11, 2013 15:41
My very fast Bash prompt, which shows git branch, virtualenv, and background jobs
# prompt examples:
# [3 jobs master virtualenv] ~/code/myproject/foo
# [1 job my-branch virtualenv] ~/code/bar/
# [virtualenv] ~/code/
# ~
# Very, very fast, only requiring a couple of fork()s (and no forking at all to determine the current git branch)
if [[ "$USER" == "root" ]]
then
export PS1="\e[1;31m\]\u \[\e[1;33m\]\w\[\e[0m\] ";
@dschep
dschep / gist:4105713
Last active March 21, 2023 01:47
Gmvault on Synology NAS
  1. Install Python from DSM Package Center
  2. Enable SSH
  3. SSH in
  4. Enable and switch to user shell (optional, requres user homes to be enabled)
    • set shell to /bin/ash in /etc/passwd
    • su - <user>
  5. Create directory to store all of this (optional)
    • mkdir gmvault&&cd gmvault
  6. Get virtualenv
  • wget https://raw.github.com/pypa/virtualenv/develop/virtualenv.py
@samsondav
samsondav / disable-gmail-cmd-enter.user.js
Last active January 22, 2024 15:42
Disable cmd+enter send in gmail
// ==UserScript==
// @name Gmail disable cmd+enter
// @namespace sampdavies@gmail.com
// @description Disables cmd+enter from sending an email in gmail
// @include ^https?:\/\/mail\.google\.com.*$
// @version 1
// @grant none
// ==/UserScript==
(function(){
var isMac = unsafeWindow.navigator.oscpu.toLowerCase().contains("mac os x");