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 ActsAsTaggableOn | |
| mattr_accessor :ignore_case_for_mysql | |
| @@ignore_case_for_mysql = false | |
| class Tag | |
| class << self | |
| def named_any_with_ignore_case(list) | |
| if ActsAsTaggableOn.ignore_case_for_mysql | |
| where(list.map { |tag| sanitize_sql(["name = ?", tag.to_s.mb_chars.downcase]) }.join(" OR ")) | |
| else |
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 | |
| require 'rubygems' | |
| require 'open-uri' | |
| require 'nokogiri' | |
| # Run `emojibomb` to get three emoji. | |
| # Run `emojibomb N`, where `N` is a positive integer to get N emoji. | |
| doc = Nokogiri::HTML(open("http://www.emoji-cheat-sheet.com/")) | |
| emoji = doc.css('.name') |
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
| /* Prototype JavaScript framework, version 1.7 | |
| * (c) 2005-2010 Sam Stephenson | |
| * | |
| * Prototype is freely distributable under the terms of an MIT-style license. | |
| * For details, see the Prototype web site: http://www.prototypejs.org/ | |
| * | |
| *--------------------------------------------------------------------------*/ | |
| var Prototype = { |
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
| # Design a data structure supporing the following: | |
| # 1) Push an element | |
| # 2) Pop an element | |
| # 3) Find Minimum in the data structure | |
| # Push(12) | |
| # 12 | |
| # Min() ==> 12 |
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
| pg_ctl -D /usr/local/var/postgres -m immediate stop |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/ruby | |
| require 'benchmark' | |
| puts "Running Ruby #{RUBY_VERSION}" | |
| ary = [] | |
| 200.times { | |
| ary << {:bar => Time.at(rand * Time.now.to_i)} | |
| } |
OlderNewer