Skip to content

Instantly share code, notes, and snippets.

View skorfmann's full-sized avatar

Sebastian Korfmann skorfmann

View GitHub Profile
@skorfmann
skorfmann / Gemfile
Created April 9, 2014 06:39
A super simple Sinatra API to expose the status of a unit / job within a CoreOS cluster.
source "https://rubygems.org"
gem 'sinatra'
gem 'etcd'
group :development do
gem 'rake'
gem 'rspec'
gem 'rack-test'
gem 'shotgun'
alias rs='rails server'
alias rc='rails console'
alias rg='rails generate'
alias r='ruby'
alias be='bundle exec'
alias gst='git status' # Show the status
alias gl='git pull --rebase' # Pull rebase
alias gp='git push' # Push
alias gu='git up' # Push
shared_examples 'included before filter' do |expected_filter, actions|
controller do
skip_filter *_process_action_callbacks.map(&:filter).reject {|filter| filter == expected_filter }
actions.each do |action|
define_method(action) do
render nothing: true
end
end
end
$('.images').append('<%= escape_javascript(render(:partial => "image", :object => @image)) %>');
$('#<%= dom_id(@image) %> span').rest_in_place('<%= image_path(@image) %>', 'image', 'title');
if ($('#images').css('display') == 'none') {
$('#images').slideDown(1000);
}
require 'rubygems'
#doesn't work as expected. conflicts with utility belt
if ENV.include?('RAILS_ENV')
if !Object.const_defined?('RAILS_DEFAULT_LOGGER')
require 'logger'
Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT))
end
require 'hirb'