Skip to content

Instantly share code, notes, and snippets.

Eduard Siebert eddiesel

Block or report user

Report or block eddiesel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View unicorn.rb
# Sample verbose configuration file for Unicorn (not Rack)
#
# This configuration file documents many features of Unicorn
# that may not be needed for some applications. See
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb
# for a much simpler configuration file.
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
View uri_validator.rb
require 'addressable/uri'
# Source: http://gist.github.com/bf4/5320847
# Accepts options[:message] and options[:allowed_protocols]
# spec/validators/uri_validator_spec.rb
class UriValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
uri = parse_uri(value)
if !uri
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@eddiesel
eddiesel / ruby_ftp_example.rb
Created Aug 16, 2012 — forked from 3dd13/ruby_ftp_example.rb
Sample code of using Ruby Net::FTP library. Login to FTP server, list out files, check directory existence, upload files
View ruby_ftp_example.rb
require 'net/ftp'
CONTENT_SERVER_DOMAIN_NAME = "one-of-the-ftp-server.thought-sauce.com.hk"
CONTENT_SERVER_FTP_LOGIN = "saucy-ftp-server-login"
CONTENT_SERVER_FTP_PASSWORD = "saucy-ftp-server-password"
# LOGIN and LIST available files at default home directory
Net::FTP.open(CONTENT_SERVER_DOMAIN_NAME, CONTENT_SERVER_FTP_LOGIN, CONTENT_SERVER_FTP_PASSWORD) do |ftp|
files = ftp.list
@eddiesel
eddiesel / getbundles.md
Created Aug 13, 2012 — forked from trey/getbundles.md
Installing GetBundles on a Fresh Copy of TextMate
View getbundles.md

Installing GetBundles on a Fresh Copy of TextMate

$ mkdir -p ~/Library/Application\ Support/TextMate/Bundles
$ cd !$
$ svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/
$ osascript -e 'tell app "TextMate" to reload bundles'

Sources

@eddiesel
eddiesel / gist:2492856
Created Apr 25, 2012 — forked from sghael/gist:896445
Capistrano recipe for multi-stage deployment running Passenger standalone
View gist:2492856
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require "rvm/capistrano"
# REPLACE this below with your ruby version/gemset version: YOUR_RUBY_VERSION@YOUR_GEM_SET
set :rvm_ruby_string, 'ruby-1.9.2-p136@example_gemset'
set :use_sudo, false
set :stages, %w(production staging)
set :default_stage, "staging"
require 'capistrano/ext/multistage'
@eddiesel
eddiesel / Capistrano-Deployment-Recipe.rb
Created Mar 19, 2012 — forked from mrrooijen/Capistrano-Deployment-Recipe.rb
a "base" Capistrano Rails Deployment Recipe. Use it to deploy your Rails application. It is also easily expandable. So feel free to grab this Recipe and add your own tasks/customization!
View Capistrano-Deployment-Recipe.rb
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
You can’t perform that action at this time.