Skip to content

Instantly share code, notes, and snippets.

View moneal's full-sized avatar

Morgan O'Neal moneal

View GitHub Profile
// Attempt to make a drop-and-forget bunch of scripts that mimick some missing html5 goodies automatically
// Example:
// $(document).ready(function() {
// ProvideHtml5.autofocus()
// ProvideHtml5.datepicker()
// ProvideHtml5.forcenumber()
// })
var ProvideHtml5 = {
autofocus = function() {
@moneal
moneal / custom.js
Created January 7, 2010 18:52
little jQuery snippets that I use on most sites.
$(document).ready(function () {
$('a.new-window, a[rel=external]').live("click", function(){
window.open(this.href);
return false;
});
jQuery.fn.center = function (onTopOf) {
this.css("position","absolute");
@moneal
moneal / remove_svn.sh
Created January 8, 2010 00:10
remove .svn folders
#!/bin/sh
echo "recursively removing .svn folders from"
pwd
rm -rf `find . -type d -name .svn`
rm `find ./ -regex ".*~.*"`
rm `find ./ -regex ".*swp$"`
@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'
@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 / 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:1596253
Created January 11, 2012 19:13
get mail queue size
mailq | tail -1 | cut -d' ' -f5
@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: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 / 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 {