brew bundle dump
This file contains 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 TransientError < StandardError | |
def report_error! | |
@report_error = true | |
end | |
# skip error reporting by default until we're told to report error | |
def skip_reporting_error? | |
!@report_error | |
end | |
end |
This file contains 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
# When intercom javascript is excluded from HTML, any attempt to invoke `window.Intercom(...)` would | |
# result in runtime error. This patch introduces a callback into the controller, so that a shim can | |
# be inserted, when intercom javascript is excluded. | |
# | |
# Remove this patch and update your code if alternative at https://github.com/intercom/intercom-rails/pull/344 | |
# is accepted. | |
spec = Bundler.definition.specs.find{|s| s.name == 'intercom-rails'} | |
if Gem::Dependency.new(spec.name, '> 0.4.2').match?(spec.name, spec.version) | |
raise Gem::DependencyError, "Check that patch is still applicable for intercom-rails gem version #{spec.version}" |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Browser events</title> | |
</head> | |
<body> | |
<div> | |
https://mdn.github.io/learning-area/javascript/building-blocks/events/show-video-box.html | |
<button>Click me</button> | |
</div> |
This file contains 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
Bourne Shell Reference: | |
This file contains short tables of commonly used items in this shell. In | |
most cases the information applies to both the Bourne shell (sh) and the | |
newer bash shell. | |
Tests (for ifs and loops) are done with [ ] or with the test command. |
This file contains 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
/* | |
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod | |
May contain errors where latitude and longitude are off. Use at own non-validated risk. | |
*/ | |
SET NAMES utf8; | |
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; | |
DROP TABLE IF EXISTS postcodes_geo; |
This file contains 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
headers['X-Accel-Buffering'] = 'no' | |
headers['Cache-Control'] = 'no-cache' | |
headers['Content-Type'] = 'text/csv; charset=utf-8' | |
headers['Content-Disposition'] = 'inline; filename="data.csv"' | |
headers['Content-Encoding'] = 'gzip' | |
sql = "select * from something;" | |
self.response_body = SqlToCsvStreamer.new(sql) |
This file contains 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 User < ActiveRecord::Base | |
# == Constants ============================================================ | |
GENDERS = [[‘Male’, ‘m’], [‘Female’, ’f’]].freeze | |
# == Attributes =========================================================== | |
# paperclip | |
attr_accessor :remove_logo |
This file contains 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 Ticket < ActiveRecord::Base | |
belongs_to :grouper | |
belongs_to :user | |
validate :user_cant_be_blacklisted, on: :confirmation | |
validate :user_cant_double_book, on: :confirmation | |
validate :grouper_cant_be_full, on: :confirmation | |
validate :grouper_cant_have_occurred, on: :confirmation |
This file contains 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
Admin | |
[] enable/disable inspection module on agency | |
PM can go through the whole motion | |
[] update property condition | |
add item to condition area /property/144/condition/area/5173 | |
then click back /property/144/condition | |
items count is still the old items count | |
inspection report |
NewerOlder