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
diff --git a/README.md b/README.md | |
index 97c0bfb..365acbd 100644 | |
--- a/README.md | |
+++ b/README.md | |
@@ -18,7 +18,7 @@ or install via gem | |
gem install pusher | |
``` | |
-After registering at <https://dashboard.pusher.com/>, configure your Pusher Channels app with the security credentials. | |
+After registering at <https://dashboard.pusher.com/>, configure your Channels app with the security credentials. |
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
def call | |
scope = base_relation.joins(:care_periods) | |
if params.care_provider_id.present? | |
scope = scope | |
.where(care_periods: { care_provider_id: params.care_provider_id }) | |
end | |
if params.hospital_id.present? | |
scope = scope |
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
codeMirror.setOption('onDragEvent', function(cm, e) { | |
// Move the cursor as they drag. | |
var pos = codeMirror.coordsChar({left: e.x, top: e.y }); | |
codeMirror.setCursor(pos); | |
codeMirror.focus(); | |
var isImageDrop = e.type == 'drop' && e.dataTransfer.files && e.dataTransfer.files.length > 0 && e.dataTransfer.files[0].type && e.dataTransfer.files[0].type.indexOf('image/') > -1; | |
if (!isImageDrop) return; | |
event.preventDefault(); |
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
require 'benchmark' | |
STRING = 'Haha hah hahaa ahah!!' | |
FIND = 'a' | |
REPLACE = 'o' | |
STRING.tr(FIND, REPLACE) == STRING.gsub(FIND, REPLACE) or abort | |
Benchmark.bmbm do |bm| | |
bm.report '.tr' do |
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
raise FucktardError, 'You nuts?!?' |
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> | |
<head> | |
<style> | |
body { text-align: center } | |
h1 { font-size: 56px } | |
</style> | |
<link href="http://fonts.googleapis.com/css?family=Ruge+Boogie" rel="stylesheet"> | |
<script> | |
WebFontConfig = { google: { families: [ 'Butterfly+Kids::latin' ] } } | |
;(function() { |
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
# config/initializers/net_http_debug.rb | |
if Rails.env.development? | |
require 'net/http' | |
Net::HTTP.class_eval do | |
class << self | |
attr_accessor :debug | |
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
if Array < Object | |
puts 'Cool, “<” can be used to test class inheritance.' | |
end | |
if Object > Array | |
puts 'Cool, works the other way too.' | |
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
require 'benchmark' | |
require 'json' | |
str = '{"foo": "bar"}' | |
Benchmark.benchmark Benchmark::CAPTION, 11 do |bm| | |
bm.report 'JSON.load' do | |
500_000.times { JSON.load(str) } | |
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
# encoding: utf-8 | |
require 'minitest/autorun' | |
# `gem install unicode_utils` | |
require 'unicode_utils/downcase' | |
require 'unicode_utils/upcase' | |
module HumanName | |
def self.all_lower_case?(name) |
NewerOlder