This file contains 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() |
This file contains 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 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 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 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 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 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 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
source :rubygems | |
gem 'rack' |
This file contains 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
# config/initializers/markdown_handler.rb | |
module MarkdownHandler | |
def self.erb | |
@erb ||= ActionView::Template.registered_template_handler(:erb) | |
end | |
def self.call(template) | |
compiled_source = erb.call(template) | |
"Kramdown::Document.new(begin;#{compiled_source};end, auto_ids: false).to_html" |
This file contains 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
mutt -e 'set content_type="text/html"' you@example.com -s "HTML Email Test" < message.html |
OlderNewer