Skip to content

Instantly share code, notes, and snippets.

View danbeam's full-sized avatar
🚲

Dan Beam danbeam

🚲
  • Los Angeles, CA
View GitHub Profile
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
myManageHook = composeAll
[ className =? "Gimp" --> doFloat
, className =? "Xmag" --> doFloat
(function() {
var host = 'https://rawgit.com/chromium/requestautocomplete-magento-extension/master/';
var script = document.createElement('script');
script.src = host + 'js/requestautocomplete/checkout.js';
script.onload = function() { requestAutocomplete.enable(); };
document.documentElement.appendChild(script);
var link = document.createElement('link');
link.href = host + 'skin/frontend/base/default/css/requestautocomplete/checkout.css';
# screw with somebody (put in ~/.bashrc or ~/.bash_profile)
function uptime {
/usr/bin/uptime | sed -re 's/up[^,]+/up 99999 days/g';
}
( cat <<EOT
anonymize () {
[ ! -z \$PS1 ] && export PS2=\$PS1;
export PS1='user@host:~\$ ';
}
unanonymize () {
[ ! -z \$PS2 ] && export PS1=\$PS2;
unset PS2;
_______ _______ _ _________ _______
( ____ )( ___ )( ( /|\__ __/( ____ \
| ( )|| ( ) || \ ( | ) ( | ( \/
| (____)|| (___) || \ | | | | | |
| _____)| ___ || (\ \| | | | | |
| ( | ( ) || | \ | | | | |
| ) | ) ( || ) \ |___) (___| (____/\
|/ |/ \||/ )_)\_______/(_______/
YOUR TESTS FAILED
@danbeam
danbeam / CSS-micro-optimizations.md
Created January 22, 2011 00:48
A list of teeny-tiny optimizations you know of that you can do safely in CSS

Things you can safely do:

Unary terms with 0 measurements:

margin-left: 0em;                      -> margin-left:0;
margin-left: 0ex;                      -> margin-left:0;
margin-left: 0cm;                      -> margin-left:0;

margin-left: 0mm; -> margin-left:0;

@danbeam
danbeam / chromium_update_manager_failures.md
Created March 9, 2011 17:57
the ppa I added to /etc/apt/sources.list is 404ing when using update manager to try to upgrade

from my /etc/apt/sources.list

 # Google chrome
 deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main
 deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main

update manager's error output

// for everybody except IE
function replaceHtml(el, html) {
var oldEl = typeof el === "string" ? document.getElementById(el) : el;
var newEl = oldEl.cloneNode(false);
newEl.innerHTML = html;
oldEl.parentNode.replaceChild(newEl, oldEl);
/* Since we just removed the old element from the DOM, return a reference
to the new element, which can be used to restore variable references. */
return newEl;
};
@danbeam
danbeam / wtfjs
Created March 29, 2011 23:41
seriously, though, wtf js?
(function (b) {
return 1<!--b;
}(1)); // what do I return?
@danbeam
danbeam / another wtf
Created March 29, 2011 23:53
seriously, you suck, JS
undefined === (function () {
return <!-- muhahah! you'll never evaluate me!
}()); // true