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
| /* | |
| Charles Blanc's 12 colors scheme | |
| rgb mapping via https://upload.wikimedia.org/wikipedia/commons/5/55/Color_star-en.svg | |
| */ | |
| .red { color: rgb(255, 0, 0) } | |
| .red-orange { color: rgb(250, 59, 12) } | |
| .orange { color: rgb(247, 134, 9) } |
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
| gem install pg -v '0.18.2' -- --with-pg-config=/usr/pgsql-9.4/bin/pg_config |
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
| <% form_for(:invoice, @invoice, :url => {:action=>'update'}, :html => { :method => :put }) do |f| %> |
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
| <script language="JavaScript"> | |
| var timerID = null; | |
| var timerRunning = false; | |
| function showtime() { | |
| today = new Date(); | |
| BigDay = new Date("october 6, 2011 10:00:00") | |
| msPerDay = 24 * 60 * 60 * 1000 ; | |
| timeLeft = (BigDay.getTime() - today.getTime()); | |
| e_daysLeft = timeLeft / msPerDay; | |
| daysLeft = Math.floor(e_daysLeft); |
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
| class Site < ActiveRecord::Base | |
| def self.build_conditions(ids, name=nil, state=nil) | |
| cond = [] | |
| cond << send(:sanitize_sql_array, ["id NOT IN (?)", ids]) unless ids.empty? | |
| cond << send(:sanitize_sql_array, ["name = ? ", name]) unless name | |
| cond << send(:sanitize_sql_array, ["state = ? ", state]) unless state | |
| cond.join(" and ") | |
| end | |
| 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
| 1000000000 + rand(9000000000) |
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
| Sunspot.search(Post) do | |
| any_of do | |
| with(:expired_at).greater_than(Time.now) | |
| with(:expired_at, nil) | |
| end | |
| end |