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
# I'm writing markdown syntax in README | |
content = File.open("README.markdown").read | |
markdown = RDiscount.new(content) | |
puts markdown.to_html | |
##if it fails, gem i rdiscount | |
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
Team.transaction do | |
u1, u2 = @team.users_teams | |
u1.position = 'p2' | |
u2.position = 'p1' | |
u1.save! | |
u2.save! | |
@team.save! | |
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
begin | |
require "autotest/fsevent" | |
rescue LoadError | |
STDERR.puts "gem i autotest-fsevent " | |
end | |
Autotest.add_hook :red do | |
Kernel.system("/usr/bin/afplay ~/no.mp3") | |
false | |
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
development: | |
ssl: false | |
localize: false | |
use_r: false | |
testing: | |
ssl: false | |
localize: false | |
use_r: true |
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
openssl s_client -connect ss3.experian.com:443 -CApath /etc/ssl/certs/ | |
CONNECTED(00000003) | |
depth=2 /C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority - G2/OU=(c) 1998 VeriSign, Inc. - For authorized use only/OU=VeriSign Trust Network | |
verify return:1 | |
depth=1 /C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c)09/CN=VeriSign Class 3 Secure Server CA - G2 | |
verify return:1 | |
depth=0 /C=US/ST=Texas/L=mckinney/O=Experian Information Solutions Inc/OU=Systems Integration/OU=Terms of use at www.verisign.com/rpa (c)05/CN=ss3.experian.com | |
verify return:1 | |
--- | |
Certificate chain |
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
log_file=install.log | |
touch $log_file | |
sudo apt-get update --system >> $log_file 2>&1 | |
#build tools, ideas from rvm and railsready.sh | |
sudo apt-get -y install autoconf automake bison build-essential clang curl git-core libc6-dev libcurl4-openssl-dev libffi-dev libreadline6 libreadline6-dev libssl-dev libtool libxml2 libxml2-dev libxslt-dev libyaml-dev ncurses-dev openssl wget zlib1g zlib1g-dev >> $log_file 2>&1 | |
#database sqlite | |
sudo apt-get -y install libsqlite3-0 sqlite3 libsqlite3-dev >> $log_file 2>&1 |
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 FixtureNameWithSlashIsNotTableNameFixturesTest < ActiveRecord::TestCase | |
set_fixture_class 'admin/accounts' => Account | |
fixtures 'admin/accounts' | |
# Set to false to blow away fixtures cache and ensure our fixtures are loaded | |
# and thus takes into account our set_fixture_class | |
self.use_transactional_fixtures = false | |
def test_named_accessor | |
assert_kind_of Account, admin_accounts(:signals37) | |
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
current_db = Rails.configuration | |
.database_configuration[Rails.env]['database'] | |
sql = ActiveRecord::Base.connection() | |
all_tables = sql.execute "select TABLE_SCHEMA, TABLE_NAME | |
from information_schema.TABLES | |
where TABLE_SCHEMA = '#{current_db}' | |
and TABLE_NAME <> 'schema_migrations';" |
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
rake routes | |
GET / pages#demo | |
rails s | |
[2012-01-29 10:15:24] INFO WEBrick 1.3.1 | |
[2012-01-29 10:15:24] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] | |
[2012-01-29 10:15:24] INFO WEBrick::HTTPServer#start: pid=4900 port=3000 | |
[2012-01-29 10:15:45] ERROR ArgumentError: comparison of Fixnum with :debug failed | |
/home/pablo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/logger.rb:326:in `<' | |
/home/pablo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/logger.rb:326:in `add' |
OlderNewer