Felipe Elias Philipp felipeelias

View party.java
1 2 3 4 5 6 7 8 9 10
LaundryMachine washer = getLaundryMachine();
washer.open();
 
List<Unerdwear> pileOfUnerdwear = gatherUnerdwear();
for (Unerdwear underwear : pileOfUnerdwear) {
if (underwear.isDirty() OR underwear.isSticky()) {
washer.load(underwear);
} else {
putOn(underwear);
while (undewear.isntDirty()) {
View application.rb
1 2
require 'middlewares/extended_logger_middleware'
config.middleware.insert_after Rails::Rack::Logger, ::ExtendedLoggerMiddleware
View spec_helper.rb
1 2 3 4 5 6 7 8 9 10
RSpec.configure do |config|
config.around do |example|
# For examples using capybara-webkit for example.
# Remove this if you don't use it or anything similar
if example.metadata[:js]
example.run
 
ActiveRecord::Base.connection.execute("TRUNCATE #{ActiveRecord::Base.connection.tables.join(',')} RESTART IDENTITY")
else
ActiveRecord::Base.transaction do
View selector.rb
1 2 3 4 5 6
Capybara.add_selector :record do
xpath { |record| XPath.css("#" + ActionController::RecordIdentifier.dom_id(record)) }
match { |record| record.is_a?(ActiveRecord::Base) }
# for Mongoid
# match { |record| record.class.ancestors.include? Mongoid::Document }
end
View gist:3259519
1 2 3 4 5 6 7 8 9
HAI
CAN HAS STDIO?
I HAS A VAR
IM IN YR LOOP
UP VAR!!1
VISIBLE "KTHX <33"
IZ VAR BIGGER THAN 100? KTHX
IM OUTTA YR LOOP
KTHXBYE
View html_with_coderay.rb
1 2 3 4 5 6 7 8 9 10
# Gemfile
gem 'coderay', '~> 0.9.8'
gem 'redcarpet', '2.0.0b5'
 
# lib/html_with_coderay.rb
class HTMLWithCoderay < Redcarpet::Render::HTML
def block_code(code, language)
language = language.blank? ? "text" : language
CodeRay.scan(code, language).div
end
View gemspec
1 2 3 4 5 6 7
Gem::Specification.new do |s|
# bla, bla..
 
if Gem::Version.new(RUBY_VERSION.dup) <= Gem::Version.new("1.8.7")
s.add_dependency "gem_required_to_ruby_version_less_than_1.8.7"
end
end
View post-receive.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
 
APP_PATH=/home/applicake/app
 
# Production environment
export RAILS_ENV="production"
 
export PATH="/opt/ruby/bin:$PATH"
 
exit_with_error() {
View nginx.sh
1 2 3 4 5 6 7 8 9 10
#! /bin/sh
 
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
View posts.rb
1 2 3 4 5 6 7 8 9
require 'date'
 
class Month
attr_accessor :year, :month
 
def initialize(year, month)
self.year = year
self.month = month
end
Something went wrong with that request. Please try again.