This file contains hidden or 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 Vienna | |
module Ajax | |
module ClassMethods | |
def url(url = nil) | |
url ? @_url = url : @_url | |
end | |
def from_form(form) |
This file contains hidden or 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 | |
class Object | |
# An object is blank if it's false, empty, or a whitespace string. | |
# For example, '', ' ', +nil+, [], and {} are all blank. | |
# | |
# This simplifies: | |
# | |
# if address.nil? || address.empty? | |
# |
This file contains hidden or 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 Vienna | |
module Sorting | |
module ClassMethods | |
def sorted_by(field, options = {}) | |
@_sort_field = field | |
@_sort_descending = options.fetch(:order, "asc") != 'asc' | |
end |
This file contains hidden or 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
# rails initializer to load *.ini into Rails.application.config | |
Dir.glob(File.join Rails.root, "/config/**/*.ini").each do |file_name| | |
config_name = File.basename(file_name, ".ini") | |
Rails.application.config.send "#{config_name}=", IniFile.new(file_name).to_struct.send(Rails.env) | |
end |
This file contains hidden or 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
// generates link to new issue form with prefilled values | |
// save the following code(single line) as bookmark | |
// use on new issue form to generate link | |
javascript:try{$('textarea[id=issue_description]').val(CKEDITOR.instances["issue_description"].getData());}catch(e){}s=$.param($('#issue-form *[name!=authenticity_token]').serializeArray());alert(location.href+"?"+s); |
This file contains hidden or 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 TenantModel | |
def self.included(base) | |
base.extend ClassMethods | |
base.instance_eval do | |
acts_as_tenant | |
end | |
end | |
class InvalidTenant < SecurityError; end |
This file contains hidden or 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
production: | |
adapter: fb | |
database: ~/Documents/redmine/db/redmine.fdb | |
username: SYSDBA | |
password: masterkey | |
host: localhost | |
encoding: UTF-8 | |
create: true | |
development: |
This file contains hidden or 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
source "http://rubygems.org/" | |
gem "sinatra", "~> 1.3.0" | |
gem "thin" |
This file contains hidden or 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: puma | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Example initscript | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
OlderNewer