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
grep -e "(No route matches" log/production.log | awk '{print $(NF-1)," ",$NF}' | sort | uniq |
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
namespace :appcache do | |
desc "Create manifest" | |
task :create do | |
sprockets_manifest = Rails.root.join("public/assets/manifest.yml") | |
abort "#{sprockets_manifest} not found" unless sprockets_manifest.exist? | |
prefix = Rails.configuration.assets.prefix | |
files = YAML.load(sprockets_manifest.open).map { |_, file| "#{prefix}/#{file}" } | |
Rails.root.join("public/manifest.appcache").open("w") do |out| | |
out << "CACHE MANIFEST\n\n" | |
out << "# " << `git rev-parse HEAD` << "\n" |
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
base_classes_with_own_connection = ActiveRecord::Base.subclasses.find_all { |klass| | |
klass.method(:establish_connection).owner == (class << klass; self; end) | |
} | |
([ActiveRecord::Base] + base_classes_with_own_connection).each do |base| | |
base.establish_connection | |
end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 "delegate" | |
module DSL | |
def self.build(klass, &block) | |
delegator_klass = Class.new(SimpleDelegator, &block) | |
klass.define_singleton_method(:build) do |*args, &block| | |
klass.new(*args).tap { |base| delegator_klass.new(base).instance_eval(&block) } | |
end | |
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
@keyframes radar { | |
0% { transform: rotate(0deg); } | |
100% { transform: rotate(360deg); } | |
} | |
#wifi { | |
width: 100px; height: 100px; | |
border: double 100px; | |
border-radius: 200px; | |
border-color: black transparent transparent; | |
animation: radar 3s linear infinite; |
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
Function.prototype.inherits_from = function(parent) { | |
var Eigen = function() {}; | |
Eigen.prototype = parent.prototype; | |
this.prototype = new Eigen(); | |
this.prototype.constructor = this; | |
this.prototype.super = function() { | |
parent.apply(this, Array.prototype.slice.apply(arguments)); | |
}; | |
}; |
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
Function.prototype.make = function(self, args) { | |
if (self instanceof args.callee) return self; | |
var F = function() {}; | |
F.prototype = args.callee.prototype; | |
var o = new F(); | |
F.prototype.constructor.apply(o, Array.prototype.slice.apply(args)); | |
return o; | |
}; | |
function Foo(name) { |
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
Gem::Specification.new do |spec| | |
spec.name = 'ping_response' | |
spec.version = '0.1.0' | |
spec.platform = Gem::Platform::RUBY | |
spec.author = 'Tobias H. Michaelsen' | |
spec.email = '[email protected]' | |
spec.summary = 'Simple wrapper for Rack apps to add /ping response handler' | |
spec.description = 'Will wrap a regular Rack app and add a handler for /ping which responds with `pong` in text/plain' | |
spec.license = 'MIT' | |
spec.files = ['ping_response.rb'] |
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
/** | |
* scroll shadow with images | |
*/ | |
.wrapper { | |
position: relative; | |
width: 200px; | |
height: 300px; | |
overflow-y: auto; | |
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAUCAYAAAB7wJiVAAAEJGlDQ1BJQ0MgUHJvZmlsZQAAOBGFVd9v21QUPolvUqQWPyBYR4eKxa9VU1u5GxqtxgZJk6XtShal6dgqJOQ6N4mpGwfb6baqT3uBNwb8AUDZAw9IPCENBmJ72fbAtElThyqqSUh76MQPISbtBVXhu3ZiJ1PEXPX6yznfOec7517bRD1fabWaGVWIlquunc8klZOnFpSeTYrSs9RLA9Sr6U4tkcvNEi7BFffO6+EdigjL7ZHu/k72I796i9zRiSJPwG4VHX0Z+AxRzNRrtksUvwf7+Gm3BtzzHPDTNgQCqwKXfZwSeNHHJz1OIT8JjtAq6xWtCLwGPLzYZi+3YV8DGMiT4VVuG7oiZpGzrZJhcs/hL49xtzH/Dy6bdfTsXYNY+5yluWO4D4neK/ZUvok/17X0HPBLsF+vuUlhfwX4j/rSfAJ4H1H0qZJ9dN7nR19frRTeBt4Fe9FwpwtN+2p1MXscGLHR9SXrmMgjONd1ZxKzpBeA71b4tNhj6JGoyFNp4GHgwUp9qplfmnFW5oTdy7NamcwCI49kv6fN5IAHgD+0rbyoBc3SOjczohbyS1drbq6pQdqumllRC/0ymTtej8gpbbuVwpQfyw66dqEZyxZKxtHpJn+tZnpnEdrYBbueF9qQn93S7HQGGHnYP7w6L+YGHNtd1FJitqPAR+hERCNOFi1i1alKO6RQnjKUxL1GNjwlMsiEhcPLYTEiT9ISbN15OY/jx4SMshe9LaJRpTvHr3C/ybFYP1PZAfwfYrPsMBtnE6SwN9ib7AhLwTrBDgUKcm06FSrTfSj187x |