Skip to content

Instantly share code, notes, and snippets.

View gtzilla's full-sized avatar
🎯
Focusing

gregory tomlinson gtzilla

🎯
Focusing
View GitHub Profile
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@gabrielelana
gabrielelana / Vagrantfile
Last active January 2, 2024 18:58
How to create a VirtualBox machine with encrypted storage with Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
PASSWORD_PATH = ".password"
PASSWORD_ID_PATH = ".password_id"
# Make sure to have installed vagrant-triggers plugin
# > vagrant plugin install vagrant-triggers
# After the first `vagrant up` stop the VM and execute the following steps
@zaius
zaius / background.sh
Created January 16, 2011 23:29
How to redirect a running process output to a file and log out
ctrl-z
bg
touch /tmp/stdout
touch /tmp/stderr
gdb -p $!
# In GDB
p dup2(open("/tmp/stdout", 1), 1)
p dup2(open("/tmp/stderr", 1), 2)
@gtzilla
gtzilla / merge commits git
Created January 25, 2011 07:15
instructions I need to merge git commits together
http://stackoverflow.com/questions/598672/git-how-to-squash-the-first-two-commits
# Go back to the last commit that we want to form the initial commit (detach HEAD)
git checkout <sha1_for_B>
# reset the branch pointer to the initial commit,
# but leaving the index and working tree intact.
git reset --soft <sha1_for_A>
# amend the initial tree using the tree from 'B'
@ColinEberhardt
ColinEberhardt / .block
Last active October 27, 2019 20:05
d3fc-label-layout map example
license: mit
@gtzilla
gtzilla / module_initialized.commander.js
Last active December 2, 2018 11:47
Parse alternate to `process.argv`. IF/ELSE loads from CLI and loads from inclusion in another script
/*
initialize from alternate in CLI commander.js script
Included as a module in nodejs
instead of process.argv
https://github.com/tj/commander.js/
*/
if (require.main === module) {
@gtzilla
gtzilla / Configuring Daemontools for Ubuntu 10
Created September 3, 2010 08:17
setup daemontools on ubuntu
#!/bin/sh
## you'll have to do a couple extra steps to get this running
## there are probably other ways to handle svncanboot, but this is from the linux forum
set -e
if
touch /etc/_testr_file
then
@paulosuzart
paulosuzart / tornado_basic_auth.py
Created November 2, 2010 19:52
Sample (working) for basic http auth on tornado
def authenticated(auth):
def decore(f):
def _request_auth(handler):
handler.set_header('WWW-Authenticate', 'Basic realm=tmr')
handler.set_status(401)
handler.finish()
return False
#!/usr/bin/env python
### Requires latest boto (cuz I checked in code to boto a moment ago)
import uuid
from boto.mturk.connection import MTurkConnection
from boto.mturk.question import Question, QuestionForm, QuestionContent
from boto.mturk.question import AnswerSpecification, FreeTextAnswer
from boto.mturk.question import Overview
#from boto.mturk.qualification import Qualifications # these exist!
@gtzilla
gtzilla / helpers.js
Last active May 2, 2016 12:04
JavaScript closure state manager for a single argument, with support for default state initialization value. A JavaScript private variables method.
;(function(window) {
'use strict';
/**
filename: helpers.js
author: gregory tomlinson
license: MIT
Be a "utility" helper method
file that is namespaced to 'helpers'