-
'normalize_yaml_input' error might be caused by wrong locale settings.
# CLI locale # => "LC_ALL =" export LC_ALL="en_US" # (or your locale of choice)
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
// An Unobtrusive Javascript (UJS) driver based on explicit behavior definitions. Just | |
// put a "data-behaviors" attribute on your view elements, and then assign callbacks | |
// for those named behaviors via Behaviors.add. | |
var Behaviors = { | |
add: function(trigger, behavior, handler) { | |
document.observe(trigger, function(event) { | |
var element = event.findElement("*[data-behaviors~=" + behavior + "]"); | |
if (element) handler(element, event); | |
}); |
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 'heroku' | |
require 'taps/operation' | |
class Database | |
def self.pull(*args) | |
new.pull(*args) | |
end | |
def initialize(uri=ENV['DATABASE_URL']) | |
@uri = uri |
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
# --- | |
# Code gehört in app/helpers/application_helper.rb (oder einen anderen Helper…) | |
# --- | |
# Ausgabe: "Vor mehr als 5 Monaten"/"Vor etwa einem Jahr" — statt "Dauer: mehr als 5 Monate"/"Dauer: etwa 1 Jahr", wie es die Originalfunktion liefert | |
# Original-File: actionpack/lib/action_view/helpers/date_helper.rb, line 63 | |
# Dokumenation: http://apidock.com/rails/v2.3.8/ActionView/Helpers/DateHelper/distance_of_time_in_words | |
# Changelog: I18n.with_options-Scope geändert auf "distance_in_words_gebeugt" | |
def distance_of_time_in_words_gebeugt(from_time, to_time = 0, include_seconds = false, options = {}) | |
from_time = from_time.to_time if from_time.respond_to?(:to_time) |
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
# https://gist.github.com/1214052 | |
require 'sinatra/base' | |
class ResqueWeb < Sinatra::Base | |
require 'resque/server' | |
use Rack::ShowExceptions | |
if CFG[:user].present? and CFG[:password].present? | |
Resque::Server.use Rack::Auth::Basic do |user, password| | |
user == CFG[:user] && password == CFG[:password] |
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 ApplicationDecorator < Draper::Base | |
# See +ApplicationDecorator.humanize+ | |
def humanize(attribute, key = model.send(attribute), default = key.to_s.humanize) | |
self.class.humanize attribute, key, default | |
end | |
# By default, humanize the attributes listed. | |
# | |
# Contrived Example: |
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 InvitationsController < Devise::InvitationsController | |
# GET /resource/invitation/accept?invitation_token=abcdef | |
def edit | |
if params[:invitation_token] && self.resource = resource_class.to_adapter.find_first( :invitation_token => params[:invitation_token] ) | |
session[:invitation_token] = params[:invitation_token] | |
render :edit | |
else | |
set_flash_message(:alert, :invitation_token_invalid) | |
redirect_to after_sign_out_path_for(resource_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
worker_processes 1; | |
error_log logs/error.log; | |
events { | |
worker_connections 1024; | |
} |
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
module SingleRecipientSmtp | |
def self.included(clazz) | |
clazz.class_eval do | |
cattr_accessor :single_recipient_smtp_settings | |
end | |
end | |
def perform_delivery_single_recipient_smtp(mail) | |
mail.to = single_recipient_smtp_settings[:to] | |
mail.cc = nil |
- Install stud
$ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
- Download and install the powssl script
$ curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/7e4d2178e3733bed18fdfe737277c3cb72241d39/powssl > ~/bin/powssl
$ chmod +x ~/bin/powssl
- Run powssl to create development certificate and configure stud.
$ powssl
OlderNewer