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
.DS_Store | |
log/*.log | |
tmp/**/* | |
doc/api | |
doc/app | |
script/dev |
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 FormtasticExtensions | |
module Formtastic | |
module MarkItUpEditor | |
def self.included(base) | |
base.class_eval do | |
@mark_it_up_dependencies_included = false | |
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
# ** ERROR 1 ** | |
# FATAL: lock file "postmaster.pid" already exists | |
# HINT: Is another postmaster (PID 4646) running in data directory "/usr/local/var/postgres"? | |
# | |
# ** ERROR 2 ** | |
# Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? | |
# | |
# To fix one of this errors: | |
cat /usr/local/var/postgres/postmaster.pid # pid is the number on first line |
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
input:focus::-webkit-input-placeholder { | |
color: transparent; | |
} |
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
// ================================================ | |
// We can put everything under "bd" namespace | |
// ================================================ | |
window.bd = {}; | |
// define some util functions and/or classes under util namespace | |
bd.util = {}; | |
bd.util.toFloat = function(obj) { | |
return parseFloat(obj); | |
}; |
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
<% | |
video_code, video_width, video_height = 'nkYA1xqrdGw', 938, 555 | |
video_embed_params = { :fs => 1, :rel => 0, :hd => 1, :autoplay => 1, :modestbranding => 1, :version => 3, :enablejsapi => 1, :playerapiid => "ytplayer" } | |
player_wrapper_id, player_id = 'ytPlayerWrapper', 'ytPlayer' | |
%> | |
<% unless mobile_safari_request? %> | |
<% content_for :head do %> | |
<%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" %> | |
<% 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
module SoftDelete | |
def self.included(within) | |
within.class_eval do | |
scope :deleted, where("#{quoted_table_name}.deleted_at IS NOT NULL") | |
scope :not_deleted, where("#{quoted_table_name}.deleted_at IS NULL") | |
end | |
end | |
def not_deleted! |
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
# http://t5865.codeinpro.us/q/5150158be8432c042603131d | |
# http://stackoverflow.com/questions/2369744/rails-postgres-drop-error-database-is-being-accessed-by-other-users |
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 Jem | |
class << self | |
attr_accessor :configuration | |
end | |
def self.configure | |
self.configuration ||= Configuration.new | |
yield(configuration) | |
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
# Hamed Asghari post: http://hasghari.github.io/2013/09/15/active-record-enhanced-query-objects.html | |
class PopularProductQuery | |
def initialize(relation = Product.scoped) | |
@relation = relation.extending(Scopes) | |
end | |
def popular(time) | |
@relation.with_recent_activity(time).with_available_reviews | |
end |
OlderNewer