curl 'http://senec/lala.cgi' \
-H 'Accept: application/json, text/javascript, _/_; q=0.01' \
-H 'Accept-Language: de-DE,de;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
-H 'DNT: 1' \
-H 'Origin: http://senec' \
brew install https://gist.githubusercontent.com/ledermann/0825a492abd2d465fc589be2f4e3bff1/raw/8b9f75ae8ff3caf9327cceea7518f1fd3a14b761/imagemagick.rb
I hereby claim:
- I am ledermann on github.
- I am ledermann (https://keybase.io/ledermann) on keybase.
- I have a public key whose fingerprint is 1E2D 039D E90B 5F31 0C12 8B69 0B6D 83FB DDCE FBF3
To claim this, I am signing this object:
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
# Using Ruby 1.9.3 on OS X, installed via rbenv | |
~ $ irb | |
irb(main):001:0> require "bigdecimal" | |
true | |
irb(main):002:0> BigDecimal("0.2") / BigDecimal("0.5") | |
0.4 |
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
# Patch for ransack (https://github.com/ernie/ransack) to use scopes | |
# Helps migrating from Searchlogic or MetaSearch | |
# Place this file into config/initializer/ransack.rb of your Rails 3.2 project | |
# | |
# Usage: | |
# class Debt < ActiveRecord::Base | |
# scope :overdue, lambda { where(["status = 'open' AND due_date < ?", Date.today]) } | |
# end | |
# | |
# Ransack out of the box ignores scopes. Example: |
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
# Add this | |
public/javascripts/all.js |
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
source :gemcutter | |
gem 'rails', '~> 2.3.11' | |
gem 'i18n' | |
gem 'mysql' | |
gem 'authlogic' | |
gem 'declarative_authorization' | |
gem 'configatron' | |
gem 'mime-types', :require => 'mime/types' | |
gem 'ya2yaml' |
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
# Monkey patch for the Rails plugin "acts_as_taggable_on" to handle dirty tracking | |
# http://github.com/mbleigh/acts-as-taggable-on/issues#issue/1 | |
module ActsAsTaggableOn::Taggable | |
module Core | |
module InstanceMethods | |
def set_tag_list_on_with_dirty_tracking(context,new_list) | |
value = new_list.to_s | |
attr = "#{context.to_s.singularize}_list" | |
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
# Import a posterous.com Blog into nanoc (http://nanoc.stoneship.org) | |
# Uses Nokogiri to parse the XML data from the posterous API | |
require 'rubygems' | |
require 'nanoc3' | |
require 'nokogiri' | |
require 'open-uri' | |
module Nanoc3::Extra | |
module Importers |
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
# Liquid methods reflection for ActiveRecord | |
# Wanna know the defined liquid_methods for a given model? | |
# | |
# Example usage: | |
# | |
# class Person < ActiveRecord::Base | |
# liquid_methods :first_name, :last_name | |
# end | |
# | |
# Person.find(123).reflect_on_liquid_methods |
NewerOlder