Skip to content

Instantly share code, notes, and snippets.

View davidosomething's full-sized avatar
🍼
I have a baby.

David O'Trakoun davidosomething

🍼
I have a baby.
View GitHub Profile
@davidosomething
davidosomething / potato-dark-yayhooray.css
Created October 25, 2011 02:31
potato's dark YayHooray
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
background: none repeat scroll 0% 0% transparent;
border: 0pt none;
margin: 0pt;
outline: 0pt none;
padding: 0pt;
}
body {
background: url("http://subtlepatterns.com/patterns/robots.png") repeat fixed 0pt 0pt transparent;
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
background: none repeat scroll 0% 0% transparent;
border: 0pt none;
margin: 0pt;
outline: 0pt none;
padding: 0pt;
}
body {
background-color: #FFFFFF;
@davidosomething
davidosomething / spaan.js
Created November 8, 2011 21:33
SubtlePatterns.com AJAX appending nav
var content = $('#content'), pagination = content.find('.wp-pagenavi');
pagination.find('a').click(function(e) {
e.preventDefault();
var a = $(this),
lastEntry = content.find('div.post').last();
$.ajax({
url: a.attr('href'),
success: function(data) {
$(data).find('div.post').insertAfter(lastEntry);
pagination.find('span').removeClass('current').wrapInner('<em />');
@davidosomething
davidosomething / lamp-db-seed.rb
Created June 5, 2012 03:29
LAMP server with MySQL DB creation and seeding
require_recipe "apt"
require_recipe "openssl"
require_recipe "git"
require_recipe "mysql::server"
require_recipe "php"
require_recipe "php::module_apc"
require_recipe "php::module_curl"
require_recipe "php::module_gd"
@davidosomething
davidosomething / php-version.sh
Created November 9, 2012 06:15
Get only the version numbers, sans copyright info, for PHP
php -v | sed 1q | awk '{ print $2 }'
@davidosomething
davidosomething / fixperms.sh
Created November 16, 2012 18:27
BASH script to fix permissions of OSX Sites folder
#!/bin/bash
cd /Users/dotrakoun/Sites
# fix owner
echo "Fixing ownership of /Users/dotrakoun/Sites"
sudo chown -R dotrakoun:www /Users/dotrakoun/Sites
# fix file perms
echo "Fixing file permissions of /Users/dotrakoun/Sites"
@davidosomething
davidosomething / update_httpd_conf_phpver.sh
Last active December 13, 2015 17:29
Script to update the PHP module version used by Apache in httpd.conf. Written for josegonzalez/homebrew-php but you can edit the path to the module file (change /usr/local/Cellar to whatever)
#!/bin/bash
# you should already have $APACHE_CONF, change these if your files aren't in those paths
export APACHE_HTTPD_CONF="$APACHE_CONF/httpd.conf"
export APACHE_HTTPD_VHOSTS="$APACHE_CONF/extra/httpd-vhosts.conf"
# these require awk and sed to get the PHP version and variants of it
export PHPVER="`php -v | sed 1q | awk '{print \$2}'`"
export PHPMINORVER="`echo $PHPVER | awk -F=\".\" '{split(\$0,a,\".\"); print a[1]\"\.\"a[2]}'`"
export PHPMINORVERNUM="`echo $PHPVER | awk -F=\".\" '{split(\$0,a,\".\"); print a[1]a[2]}'`"
@davidosomething
davidosomething / get_github_ssh_key.sh
Created February 19, 2013 15:54
CLI tool to get a user's public SSH keys by their GitHub username
get_github_ssh_key() {
if [ -z "$1" ]; then
echo "Missing username"
echo
echo "USAGE: get_github_ssh_key GITHUB_USERNAME"
else
curl https://github.com/$1.keys
echo
fi
}
@davidosomething
davidosomething / open-github.sh
Last active December 14, 2015 04:28
Open current repo's github page if it has one.
# Depends on AWK, SED, and OSX's open command.
function github() {
local github_url
if ! git remote -v >/dev/null; then
return 1
fi
# get remotes for fetch
github_url="`git remote -v | grep github\.com | grep \(fetch\)$`"
@davidosomething
davidosomething / Gruntfile.js
Created March 7, 2013 21:24
Gruntfile.js for arn.com's WordPress theme
/*global module:false*/
module.exports = function (grunt) {
"use strict";
var jsMain = [
'assets/js/adc_casestudies.js',
'assets/js/adc_block.js',
'assets/js/adc_blocks.js',
'assets/js/adc_location.js',
'assets/js/adc_jobs.js',