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
| # ref: http://bit.ly/fN2ep8 | |
| # http://twitpic.com/3rr8dk | |
| def sass_colors | |
| engine= Sass::Engine.new(File.read("app/stylesheets/_colors.scss"), :syntax => :scss, :load_paths => ["app/stylesheets"]) | |
| environment= Sass::Environment.new | |
| engine.to_tree.children.each do | node | | |
| next unless node.kind_of? Sass::Tree::VariableNode | |
| node.perform environment | |
| end |
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
| #!/usr/bin/env ruby | |
| # | |
| # Nokoe: Nokogiri with pipes | |
| # | |
| # Requirements: | |
| # | |
| # gem install trollop | |
| # gem install nokogiri | |
| # |
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
| function calculate() { | |
| var result = 0; | |
| try { | |
| result = parseFloat(eval(document.getElementById('calculator').value)); | |
| if(!isNaN(result) && isFinite(result)) | |
| document.getElementById('result').value= Math.round( result * 10000 ) / 10000; | |
| } catch(err) { | |
| } | |
| } |
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
| puts "\033[1;31m=> Loading hacks: #{__FILE__}\033[0m" | |
| module BeforeFilterHacks | |
| def self.included(base) | |
| base.class_eval { alias_method_chain :call, :hacks } | |
| end | |
| def call_with_hacks(controller, &block) | |
| message= if method.kind_of?(Proc) | |
| method.to_s |
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
| # config/initializers/hacks.rb | |
| HelloController.send(:include, SomeHacks) |
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
| stalingrad ~ $ rvm install 1.9.1 | |
| /Users/aurelian/.rvm/scripts/match: line 8: conditional binary operator expected | |
| /Users/aurelian/.rvm/scripts/match: line 8: syntax error near `=~' | |
| /Users/aurelian/.rvm/scripts/match: line 8: ` [[ "$1" =~ $2 ]]' | |
| /Users/aurelian/.rvm/scripts/match: line 8: conditional binary operator expected | |
| /Users/aurelian/.rvm/scripts/match: line 8: syntax error near `=~' | |
| /Users/aurelian/.rvm/scripts/match: line 8: ` [[ "$1" =~ $2 ]]' | |
| /Users/aurelian/.rvm/scripts/match: line 8: conditional binary operator expected | |
| /Users/aurelian/.rvm/scripts/match: line 8: syntax error near `=~' | |
| /Users/aurelian/.rvm/scripts/match: line 8: ` [[ "$1" =~ $2 ]]' |
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
| require 'rubygems' | |
| require 'twitter' | |
| friend_ids= Twitter.friend_ids(USERNAME) | |
| client = Twitter::Base.new(Twitter::HTTPAuth.new(USERNAME, USERPASS)) | |
| friend_ids.each do | fid | | |
| friend= Twitter.user(fid) | |
| puts "~> #{friend.screen_name} -> #{USERNAME}: #{client.friendship_exists?(fid, USERNAME)}" | |
| end |
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
| see http://github.com/aurelian/grapi |
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
| require 'rubygems' | |
| require 'right_aws' | |
| require 'ruby-growl' | |
| require 'mime/types' | |
| require 'digest/sha1' | |
| if ARGV.size < 1 | |
| puts "-- #{__FILE__} folder" | |
| exit 1 | |
| end |