Skip to content

Instantly share code, notes, and snippets.

View ammonkc's full-sized avatar

Ammon Casey ammonkc

  • nCino, Inc.
  • Honolulu, Hi
View GitHub Profile
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
@mscottford
mscottford / update-dns.rb
Created May 24, 2010 18:52
Uses the Rackspace Apps control panel website to update the DNS A record for a subdomain.
#!/usr/bin/ruby
require 'rubygems'
require 'steam'
require 'net/http'
require 'resolv'
require 'mail'
class DnsUpdateBot
def initialize
#!/usr/bin/env ruby
# Aside from removing Ruby on Rails specific code this is taken verbatim from
# mislav's git-deploy (http://github.com/mislav/git-deploy) and it's awesome
# - Ryan Florence (http://ryanflorence.com)
#
# Install this hook to a remote repository with a working tree, when you push
# to it, this hook will reset the head so the files are updated
if ENV['GIT_DIR'] == '.'
@tekkub
tekkub / mkv2m4v.sh
Created October 11, 2010 03:37 — forked from innerfence/mkv2m4v.sh
mkv to m4v remuxer
#!/bin/bash
#
# mkv2m4v inputfile.mkv
#
# Given an MKV container with H.264 video and AC3 audio, converts
# quickly to an iPad-compatible MP4 container without re-encoding the
# video (so it must already be in an iPad-compatible resolution); the
# audio is downmixed to stereo with Dynamic Range Compression.
#
@walesmd
walesmd / MY_Model.php
Created December 6, 2010 03:18
CodeIgniter extended Model Class
<?php if (!defined('BASEPATH')) exit('No direct script access allowed.');
/* MY_Model
* Reorganizes the $DB::result() object passed to it so joined
* tables are child-objects of the result object, rather than
* first-class variables. Pretty strict on the way it works.
*
* Example:
* protected $relationships = array(
* 'has_one' => array(
/*
---
name: guilloche
script: guilloche.js
description: guilloche
provides: [Guilloche]
...
*/
@dhrrgn
dhrrgn / init.rb
Created April 1, 2011 00:19
A simple initialization script to create vhosts.
#!/usr/bin/env ruby
# USAGE: sudo ./init.rb project_name path/to/web/root
# NOTE: This file must be run with root privileges (sudo).
# You must also give it exec permissions: chmod +x init.rb
# This should include the trailing slash
DEFAULT_ROOT = '/Users/dan/Sites/'
VHOST_FOLDER = '/etc/apache2/sites/'
@dhrrgn
dhrrgn / .gitconfig
Last active September 25, 2015 14:38
An awesome .gitconfig file with some niceties.
[user]
name = Your Name
email = [email protected]
[core]
autocrlf = input
[color]
status = auto
diff = auto
branch = auto
[alias]
@jamierumbelow
jamierumbelow / original.php
Created May 16, 2011 22:52
A potential, CoffeeScript-esque nicer PHP
// ----------------------
// NO <?php TAG!
// ----------------------
// ----------------------
// SIGNIFICANT WHITESPACE ELIMINATES THE NEED
// FOR CURLY BRACES (YAY)
// ----------------------
class Sessions extends MY_Controller
@guyht
guyht / gist:1012516
Created June 7, 2011 15:42
JSHint through NodeJS
#!/usr/bin/env node
/*
* Takes a list of files and runs them through JSHint
*
* Usage:
* check.js file1 file2 file3
*/
var fs = require('fs'),