Skip to content

Instantly share code, notes, and snippets.

View cointilt's full-sized avatar
🍣
West Coast Keto!

Will Ayers cointilt

🍣
West Coast Keto!
View GitHub Profile
@cointilt
cointilt / git_commands
Created April 19, 2013 22:27
Git Commands - Because I always forget them
## Change the message in your last commit
git commit --amend -m "New commit message"
// Check existence
function exists(thing) {
return (typeof thing !== 'undefined' && thing !== null) ? thing : undefined;
}
/*
Usage...
var options = {
latitude: 0,
(function ($, document) {
$(document).ready(function () {
// Assign some vars to help cache the dom
var holder = $('.toggle-reveal');
// Hide divs if javascript is enabled
holder.find('.revealed').hide();
// On click for links
@cointilt
cointilt / log.Wrapper.js
Created June 4, 2012 16:01
Log Wrapper
window.log = function(){
log.history = log.history || []; // store logs to an array for reference
log.history.push(arguments);
if(this.console){
console.log( Array.prototype.slice.call(arguments) );
}
};
@cointilt
cointilt / gist:2597478
Created May 4, 2012 20:23
Enable screen sharing
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users admin -privs -all -restart -agent -menu
@cointilt
cointilt / click.m
Created May 4, 2012 20:08
click.ME
// File:
// click.m
//
// Compile with:
// gcc -o click click.m -framework ApplicationServices -framework Foundation
//
// Usage:
// ./click -x pixels -y pixels
// At the given coordinates it will click and release.
@cointilt
cointilt / gist:2588030
Created May 3, 2012 18:44
Default Gitconfig
[alias]
a = add .
s = status
p = push
c = checkout
po = push origin
@cointilt
cointilt / gist:1784605
Created February 10, 2012 00:07
AWS CloudFront Invalidation
<?php
class CloudFront
{
private static $access_key = '';
private static $secret_key = '';
private static $distribution = '';
private static $files = array();
private static $_error = array();
@cointilt
cointilt / gist:1453427
Created December 9, 2011 21:42
WordPress htaccess environment setup
RewriteEngine On
RewriteBase /
### SET UP ENVIRONMENT ###
RewriteRule .* - [E=ENVIRONMENT:production]
RewriteCond %{SERVER_NAME} localhost [OR]
RewriteCond %{SERVER_NAME} .dev$ [OR]
RewriteCond %{SERVER_NAME} .local$
@cointilt
cointilt / gist:1356365
Created November 10, 2011 21:53
PHP Mobile Sniffer
<?php
$useragent=$_SERVER['HTTP_USER_AGENT'];
if(preg_match('/android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon