An haml template like:
#content.padding{:style => "background:url(/images/middle.png) no-repeat top center #fff;"}
must be converted in css:
task :bash do | |
tpl = <<-TXT.gsub(/^ {4}/, '') | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
# Colors | |
export PS1='\\[\\033[01;31m\\]\\u\\[\\033[01;33m\\]@\\[\\033[01;36m\\]\\h \\[\\033[01;33m\\]\\w \\[\\033[01;35m\\]\\$ \\[\\033[00m\\]' | |
export LS_OPTIONS="--human --color=always" |
desc 'sample plugin' | |
task :sample do | |
log "Hey!" | |
end |
## | |
# File watcher | |
# | |
# Example for: https://twitter.com/rakaur/status/107070299400441858 | |
# | |
loop do | |
if File.exist?('tmp/restart.txt') | |
# TODO: add here code to reboot | |
# Remember to remove restart.txt to prevent loops |
open ~/Library/Preferences/.GlobalPreferences.plist | |
defaults write -g ApplePressAndHoldEnabled -bool false | |
reboot -h now |
class ImageUploader < CarrierWave::Uploader::Base | |
include CarrierWave::MiniMagick | |
storage :file | |
def thumb(size) | |
begun_at = Time.now | |
size.gsub!(/#/, '!') | |
uploader = Class.new(self.class) | |
uploader.versions.clear | |
uploader.version_names = [size] |
" Vim Color File | |
" Name: pong.vim | |
" Version: 0.1 | |
" Maintainer: @DAddYE | |
" | |
" Based on bubblegum. | |
set background=dark | |
hi clear |
#!/usr/bin/env ruby | |
# | |
# Usage: curl -sL https://raw.github.com/gist/1650084/invalid.rb | ruby | |
# | |
require 'open3' | |
stdin, stdout, stderr = Open3.popen3('gem check') | |
invalid = stderr.read | |
errors = invalid.scan(/\[(.+)\]:/).flatten | |
abort 'No errors in your gems specs' if errors.empty? | |
errors.each do |spec| |
# Add me in lib or somewhere | |
# lib/postmark_patch.rb | |
Mail::Message.class_eval do | |
def html? | |
content_type_without_symbol && content_type_without_symbol.include?('text/html') | |
end | |
end |
#!/usr/bin/ruby | |
# This script installs to /usr/local only. To install elsewhere you can just | |
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like. | |
module Tty extend self | |
def blue; bold 34; end | |
def white; bold 39; end | |
def red; underline 31; end | |
def reset; escape 0; end | |
def bold n; escape "1;#{n}" end |