This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TinyId | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def base | |
Radix::BASE::B62 | |
end | |
def find_by_tiny_id(string) | |
find(string.b(self.base.length).to_i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults: &defaults | |
adapter: postgresql | |
encoding: unicode | |
host: localhost | |
database: blog | |
development: | |
<<: *defaults | |
database: blog_development |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set shell=bash\ -i | |
silent !defaults write org.vim.MacVim MMTextInsetTop 0 | |
silent !defaults write org.vim.MacVim MMTextInsetRight 0 | |
silent !defaults write org.vim.MacVim MMTextInsetBottom 0 | |
silent !defaults write org.vim.MacVim MMTextInsetLeft 0 | |
let mapleader="," | |
colorscheme Solarized |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.centre = (dims = ['left', 'top'], parent = window, offset = 0) -> | |
that = @ | |
_.each dims, (dim) -> | |
prop = 'width' if dim == 'left' | |
prop = 'height' if dim == 'top' | |
parent_prop = eval("$(parent).#{prop}()") | |
this_prop = eval("$(that).#{prop}()") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -r -k -p http://example.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.placeholder = -> | |
@data('placeholder', @attr('placeholder')).removeAttr('placeholder').attr('value', @data('placeholder')) | |
@on 'focus', -> | |
$(@).attr('value', '') if @value == $(@).data('placeholder') | |
.on 'blur', -> | |
$(@).attr('value', $(@).data('placeholder')) if @value.length == 0 | |
jQuery -> $('[placeholder]').placeholder() |
NewerOlder