Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
ActiveSupport::Notifications.subscribe('deprecation.rails') do |name, start, finish, id, payload| | |
Honeybadger.notify( | |
error_class: "DEPRECATION WARNING", | |
error_message: payload[:message], | |
backtrace: payload[:callstack] | |
) | |
end |
select.form-control + .chosen-container.chosen-container-single .chosen-single { | |
display: block; | |
width: 100%; | |
height: 34px; | |
padding: 6px 12px; | |
font-size: 14px; | |
line-height: 1.428571429; | |
color: #555; | |
vertical-align: middle; | |
background-color: #fff; |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
@mixin cover-background( $path ) { | |
background-image: url( "../../" + $path ); | |
@include background-size( cover ); | |
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + $path + "', sizingMethod='scale')"; | |
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale"); | |
} |
# define a method to run rake tasks | |
def run_rake(task, options={}, &block) | |
rake = fetch(:rake, 'rake') | |
rails_env = fetch(:rails_env, 'production') | |
command = "cd #{current_path} && #{rake} #{task} RAILS_ENV=#{rails_env}" | |
run(command, options, &block) | |
end |
require 'net/http' | |
class Item | |
#replaced with dynamic initialization below | |
#attr_reader :id, :user, :state | |
# | |
# | |
# Sample JSON | |
# | |
# [{ "id":1, "user":"john", "state":"active" }, | |
# { "id":2, "user":"jane", "state":"inactive" }, |
class SomeModel < ActiveRecord::Base | |
def some_method | |
raise NotImplementedError | |
end | |
end | |
module Api::V1::SomeModelMethods | |
def some_method | |
return {:blah => 1} | |
end |
class ApplicationController < ActionController::Base | |
around_filter :set_white_label | |
private | |
def set_white_label | |
subdomains = request.subdomains - RESERVED_SUBDOMAINS | |
if subdomains.empty? | |
yield | |
return |