Skip to content

Instantly share code, notes, and snippets.

View gugl's full-sized avatar

Günter Glück gugl

View GitHub Profile
@esamattis
esamattis / application.html.erb
Last active May 19, 2019 00:36
React hot reloading with Webpack for Ruby on Rails
<script charset="utf-8">
<% if ENV["RAILS_ENV"] == "production" %>
var script = "/react-app-bundle.js";
<% else %>
console.warn("Development mode. Make sure to start 'node devServer.js'");
var script = "http://" + (location.host || 'localhost').split(':')[0] + ":4000/react-app-bundle.js"
<% end %>
document.write('<script src="' + script + '"></' + 'script>');
</script>
require 'rack'
require 'rubinius/profiler'
class RbxRackProfiler
def initialize(app)
@app = app
end
def call(env)
profiler = Rubinius::Profiler::Instrumenter.new
@kalv
kalv / gist:7147336
Last active December 26, 2015 11:59
A list of links, patches and articles to help with Mavericks os x for ruby development
@dpsk
dpsk / deploy.rb
Created July 5, 2012 12:42 — forked from mikhailov/0. nginx_setup.sh
Nginx+Unicorn (production-ready setup)
# Capistrano configuration
#
# require 'new_relic/recipes' - Newrelic notification about deployment
# require 'capistrano/ext/multistage' - We use 2 deployment environment: staging and production.
# set :deploy_via, :remote_cache - fetch only latest changes during deployment
# set :normalize_asset_timestamps - no need to touch (date modification) every assets
# "deploy:web:disable" - traditional maintenance page (during DB migrations deployment)
# task :restart - Unicorn with preload_app should be reloaded by USR2+QUIT signals, not HUP
@kazjote
kazjote / populate.rb
Created January 8, 2012 18:31
FnordMetric data generator
# Copy it to fnordmetric directory and run with
#
# bundle exec ruby -Ilib -I. populate.rb live
#
# to generate fake current traffic or
#
# bundle exec ruby -Ilib -I. populate.rb past
#
# to generate fake stats for last month.
#
@thbar
thbar / deploy.rb
Created September 7, 2010 18:18
Resque + god + capistrano recipe
# note - you may need to split into a before-deploy (stop) and after-deploy (start) depending on your setup
desc "Hot-reload God configuration for the Resque worker"
deploy.task :reload_god_config do
sudo "god stop resque"
sudo "god load #{File.join deploy_to, 'current', 'config', 'resque.god'}"
sudo "god start resque"
end
after 'deploy:update_code', 'deploy:update_shared_symlinks'