Skip to content

Instantly share code, notes, and snippets.

View moneal's full-sized avatar

Morgan O'Neal moneal

View GitHub Profile
@moneal
moneal / gist:4282681
Created December 14, 2012 04:22
Populating datasets from localstorage
if (Modernizr.localstorage) {
//console.log("Can use localstorage");
var clients = localStorage.getItem("clients");
// console.log(clients);
if ( clients == null ) {
// Fetch the clients list
$.getJSON('/api/client_list', function(data) {
@moneal
moneal / robot.js
Created December 4, 2012 01:17 — forked from AndreMeira/robot.js
bob
//FightCode can only understand your robot
//if its class is called Robot
var id;
var Robot = function(robot) {
id = this.id;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
@moneal
moneal / dabblet.css
Created April 27, 2012 22:33
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body{
background: #EFE0C9;
}
.coupon-widget {
border-radius: 6px;
background-color: #ADAEAE;
clear: both;
@moneal
moneal / dabblet.css
Created April 5, 2012 01:33
CSS BoxSpin
/**
* CSS BoxSpin
* Attempt to remake http://www.cesmes.fi/flash/boxSpin/ in CSS
*/
body {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
}
.spinner {
@moneal
moneal / gist:2032093
Created March 13, 2012 22:09
HowTo: Create a list of installed packages
\
Code:
dpkg --get-selections > installed-software
And if you wanted to use the list to reinstall this software on a fresh ubuntu setup,
Code:
dpkg --set-selections < installed-software
followed by
@moneal
moneal / gist:1760963
Created February 7, 2012 17:45
Installing APC on Ubuntu
apt-get install libpcre3-dev
pecl install apc
@moneal
moneal / gist:1596253
Created January 11, 2012 19:13
get mail queue size
mailq | tail -1 | cut -d' ' -f5
@moneal
moneal / gist:1217127
Created September 14, 2011 17:08
.gitignore
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db
._*
.Trashes
.Spotlight-V100
.svn/
.*.sw[a-z]
*.un~
@moneal
moneal / gist:1157728
Created August 19, 2011 19:13
Print line 58 in the format "<filename>:<line number> <line>" for all inc files
find . -type f -name "*.inc" -exec awk 'NR==58 {print FILENAME ":" NR ": " $0 }' {} \;
@moneal
moneal / .vimrc
Created July 14, 2010 23:53
Vim config
if &term == 'Eterm'
:set t_Co=256
endif
" Custom templates
command Copy :exec ":r ~/.vim/templates/alpine-copyright/copyright.inc"
" HTML Vars
:let g:do_xhtml_mappings = '1'