Skip to content

Instantly share code, notes, and snippets.

View tjlahr's full-sized avatar
🌴
<--

Thomas Lahr tjlahr

🌴
<--
View GitHub Profile
#!/usr/bin/env bash
export DOT_PORT=1738
function changeDot() {
echo -n $1 | nc -4u -w0 localhost $DOT_PORT
}
changeDot "white"
@tjlahr
tjlahr / 0_reuse_code.js
Last active August 29, 2015 14:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# opening and closing windows and popovers
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
# smooth scrolling
defaults write -g NSScrollAnimationEnabled -bool false
# showing and hiding sheets, resizing preference windows, zooming windows
# float 0 doesn't work
defaults write -g NSWindowResizeTime -float 0.001
#!/bin/bash
#
# (1) copy to: ~/bin/ssh-host-color
# (2) set: alias ssh=~/bin/ssh-host-color
#
# Inspired from http://talkfast.org/2011/01/10/ssh-host-color
# Fork from https://gist.github.com/773849
#
set_term_bgcolor(){
@tjlahr
tjlahr / clearfix
Created June 11, 2013 19:16
h5bp's .clearfix
/* h5bp clearfix */
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
$ rake paperclip:refresh CLASS=Spree::Product
rake aborted!
undefined method `keys' for nil:NilClass
/Users/tjlahr/.rvm/gems/ruby-1.9.3-p392/gems/paperclip-2.8.0/lib/tasks/paperclip.rake:16:in `obtain_attachments'
/Users/tjlahr/.rvm/gems/ruby-1.9.3-p392/gems/paperclip-2.8.0/lib/tasks/paperclip.rake:45:in `block (3 levels) in <top (required)>'
/Users/tjlahr/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/Users/tjlahr/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => paperclip:refresh => paperclip:refresh:metadata
(See full trace by running task with --trace)
$.fn.serializeObject = function()
{
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name]) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
@tjlahr
tjlahr / helpers.css
Created February 8, 2013 21:30
Just the css helper classes pulled from HTML5 Boiler Plate
/* ==========================================================================
Helper classes
pulled from HTML5 Boilerplate's main.css file
https://github.com/h5bp/html5-boilerplate
========================================================================== */
/*
* Image replacement
*/
@tjlahr
tjlahr / .gitignore
Created February 7, 2013 22:42
exclude OS files from git
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
@tjlahr
tjlahr / forbidden DC licenseplates
Created January 29, 2013 21:57
Forbidden license plates in Washington, D.C. pulled from FOIA document: http://www.documentcloud.org/documents/562611-dc-bannedplates-2012.html#document/p1
AAA1234AAS AASS ABADBCH ABADME ABADMF ABAD6T9 ABAD69 ABCHNZ ABDMF ABICH ABIGIO ABIGONE ABIG14U ABIM2GO ABITCH ABM ABOXDOC ABOY69 ABTCHN AB1TCH ACDCNO1 ACDC4U ACDC5I ACECOCK ACEDYOU ACEHOLE ACEKISS ACEMF ACEU ACID ACKKILR ACLIMAX ACOCKYI ACOCKY1 ACTAA55 ACW1763 AC69DC ADCRAP ADDICT1 ADEGOADICKO ADIOSMF ADOOKY ADR3801 ADT3818 ADUST AERO69 AET1 AEZ69 AFAQ2 AFASI AFASMF AFASTI AFASTMFAFATMF AFA69 AFCKN10 AFETUS AFINE69 AFMUCK AFOKGQN AFOKU AFONGOO AFOOT AFRTS AFU AFUCK AGAYLAYAGENO AGGLO AGINA AGOOD69 AGTIHS AHABHO AHARD AHARDN AHARDO AHCHIT AHCRAP AHEDJB AHEDJOB AHFARTAHFRRT AHHELL AHHELNO AHHHHSO AHHOLA AHHSOL AHLE AHMERDE AHOLE AHOOKER AHOTBOX AHOT14U AHOT69 AHPATAHSHEET AHSHIT AHSHITA AHSHT ABM16 ACES ABNORML AGELEX1 ADAWMS ABBAFTR ABD88 AGLBGL ABAZA AAROMEA ABLKMND ACTLS1Z ADCALLS ABC123 ABIRD AFOLA1 AD ANETA ACCOMAC ALFA73 AFAAX4 ADM AEWEBBACCRITE ADELAB1 AHSIT AHSOUL AHS69 AHTITI AHUG69 AHYUKFU AID AIDS4U AIFAM AIFAM1 AIM2KIL AINOFUAINOKEA AIRGAZM AISHT AISIA AITAMA AJAYI AJAY7I AJESUSO AJUJU AKADSHT AKAKI