$ rails g model User
belongs_to
has_one
As configured in my dotfiles.
start new:
tmux
start new with session name:
| #!/usr/bin/env python | |
| """ | |
| Loggly CLI interface - standalone (Just Python). Deals with paging results automatically so you can easily grab >2000 rows. | |
| Run `loggly.py --help` to see usage information. | |
| TODO: | |
| * Support XML format results (ie. combining multiple pages of results together) | |
| * Facet support |
| /** | |
| * Convert "Kana" one from another | |
| * (zen-kaku, han-kaku and more) | |
| * | |
| * @param string str | |
| * @param string option (optionaly) | |
| * @return string converted string | |
| */ | |
| function convert_kana (str, option) { | |
| option = option || "KV"; |
| #a/usr/bin/perl | |
| # This script was hastily cobbled together for my own use. It can | |
| # probably break your system. Use at your own risk. | |
| $JAIL = "/srv/http"; | |
| $USER = "http"; | |
| $GROUP = "http"; | |
| $WWW_DIR = "www"; | |
| sub run{ |
| void function() {//closure | |
| var global = this | |
| , _initKeyboardEvent_type = (function( e ) { | |
| try { | |
| e.initKeyboardEvent( | |
| "keyup" // in DOMString typeArg | |
| , false // in boolean canBubbleArg | |
| , false // in boolean cancelableArg | |
| , global // in views::AbstractView viewArg |
| 13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF | |
| | FUCKIN PUSSIES | |
| 13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS | |
| 13:16 <luite> | hello | |
| 13:16 <ChongLi> | somebody has a mental illness! | |
| 13:16 <merijn> | Wow...I suddenly see the error of my ways and feel | |
| | compelled to write Node.js! | |
| 13:16 <genisage> | hi | |
| 13:16 <luite> | you might be pleased to learn that you can compile | |
| | haskell to javascript now |
| //***************************************** | |
| // NEC (Japanese) Infrared code sending library for the Arduino | |
| // Send a standard NEC 4 byte protocol direct to an IR LED on the define pin | |
| // Assumes an IR LED connected on I/O pin to ground, or equivalent driver. | |
| // Tested on a Freetronics Eleven Uno compatible | |
| // Written by David L. Jones www.eevblog.com | |
| // Youtube video explaining this code: http://www.youtube.com/watch?v=BUvFGTxZBG8 | |
| // License: Creative Commons CC BY | |
| //***************************************** |
| $('alphaonly').keypress(function(e){ | |
| // Convert the character code to a string | |
| var strIn = String.fromCharCode(e.charCode); | |
| // The current cursor position is stored as: e.target.selectionStart | |
| if(e.target.selectionStart == 0) { | |
| // Setup our pattern, excluding anything other than a-zA-Z | |
| var patt = /[a-zA-Z]/gi; | |
| } else { | |
| // Setup our pattern to allow alpha, spaces and dashes |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"