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 Module | |
# Provides a delegate class method to easily expose contained objects' methods | |
# as your own. Pass one or more methods (specified as symbols or strings) | |
# and the name of the target object as the final :to option (also a symbol | |
# or string). At least one method and the :to option are required. | |
# | |
# Delegation is particularly useful with Active Record associations: | |
# | |
# class Greeter < ActiveRecord::Base | |
# def hello() "hello" end |
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 "benchmark" | |
require "fileutils" | |
def test | |
path = "/tmp/faketest" | |
FileUtils.mkdir_p("#{path}/public/stylesheets") | |
FileUtils.mkdir_p("#{path}/public/javascripts") | |
FileUtils.mkdir_p("#{path}/public/images") | |
FileUtils.mkdir_p("#{path}/views/templates") | |
FileUtils.mkdir_p("#{path}/views/layouts") |
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
#relevant lines in features/support/env.rb | |
Capybara.default_selector = :css | |
Capybara.javascript_driver = :culerity | |
Capybara.ignore_hidden_elements = true | |
#features/hidden_text_testing.feature | |
@javascript | |
Scenario: Testing test hidden via inline style with 'should not see' | |
When I visit the the public index.html page | |
Then I should not see "Hidden Via Comment" |
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
Ruby 1.9.0.0 compile error (openssl problem) | |
TAGS: None | |
Found these error: | |
view sourceprint? | |
compiling openssl | |
gcc -I. -I../../.ext/include/i686-darwin10.2.0 -I../.././include -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\" -fno-common -g -O2 -pipe -fno-common -o openssl_missing.o -c openssl_missing.c | |
In file included from openssl_missing.c:22: |
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
# sudo gem install bson | |
# sudo gem install bson_ext | |
# sudo gem install yajl-ruby | |
# sudo gem install json | |
# sudo gem install msgpack | |
require 'rubygems' | |
require 'benchmark' | |
require 'yaml' | |
require 'bson' |
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
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations) | |
# By Peter Cooper | |
# | |
# MIT license | |
# | |
# * Not advised to use in your production environment! ;-) | |
# * Requires Ruby 1.9 | |
# * Supports A and CNAME records | |
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance | |
# * All records get the same TTL |
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
//....add this in app/assets/javascript/active_admin.js | |
$(function(){ | |
// CONFIGURE PANELS COLLAPSER | |
$(".panel[data-panel]").each(function(){ | |
var $this = $(this); | |
var $a = $("<a href='javascript:void(null)'>").on("click",function(event){ | |
$(this).closest(".panel").find(".panel_contents").each(function(){ | |
$(this).slideToggle(); | |
}); | |
$(this).closest("h3").each(function(){ |
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
Open FileMerge from command line | |
opendiff | |
If the command-line doesn't work, and you have no /Developer directory anymore, you probably need to: | |
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer |
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
#!/usr/bin/env bash | |
uninstall() { | |
list=`gem list --no-versions` | |
for gem in $list; do | |
gem uninstall $gem -aIx | |
done | |
gem list | |
gem install bundler | |
} |
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
Select all and delete (actually move to buffer) | |
:%d | |
Select all and copy to buffer | |
:%y | |
Use p to paste the buffer. |
OlderNewer