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
# Trace is a model in vendor/plugins/mylogger/lib/app/models/trace.rb | |
# vendor/plugins/mylogger/lib/mylogger.rb | |
#... | |
module MyLoggerImpl | |
def self.trace(controller_instance) | |
puts 'Tracing' |
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
module ApplicationHelper | |
def jsubmit_button(value = "Confirm", options = {}) | |
content_for :head do | |
javascript_tag "$(function() { | |
$( '#jsubmit_button').button({ | |
icons: { | |
primary: \"ui-icon-check\" | |
}, | |
text: 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
# encoding: utf-8 | |
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
user ||= User.new # guest | |
user.roles.each do |role| | |
role.permissions.each do |permission| | |
if permission.subject_class == 'all' |
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
➜ smsy git:(master) ✗ rails s | |
=> Booting WEBrick | |
=> Rails 3.1.0.rc4 application starting in development on http://0.0.0.0:3000 | |
=> Call with -d to detach | |
=> Ctrl-C to shutdown server | |
[2011-06-22 13:34:39] INFO WEBrick 1.3.1 | |
[2011-06-22 13:34:39] INFO ruby 1.9.2 (2011-02-18) [x86_64-darwin10.7.0] | |
[2011-06-22 13:34:39] INFO WEBrick::HTTPServer#start: pid=60275 port=3000 | |
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
Started GET "/assets/application.js" for 127.0.0.1 at 2011-06-22 13:51:25 -0400 | |
Compiled ~/Intermeta/smsy/app/assets/javascripts/application.js (3ms) (pid 60381) | |
Compiled ~/.rvm/gems/ruby-1.9.2-p180@rails31rc4/gems/jquery-rails-1.0.11/vendor/assets/javascripts/jquery.js (1ms) (pid 60381) | |
Compiled ~/.rvm/gems/ruby-1.9.2-p180@rails31rc4/gems/jquery-rails-1.0.11/vendor/assets/javascripts/jquery_ujs.js (0ms) (pid 60381) | |
Compiled ~/Intermeta/smsy/app/assets/javascripts/posts.js.coffee (80ms) (pid 60381) | |
Compiled ~/Intermeta/smsy/app/assets/javascripts/welcome.js.coffee (0ms) (pid 60381) | |
Served asset /application.js - 304 Not Modified (91ms) (pid 60381) | |
/Users/eduardo/.rvm/gems/ruby-1.9.2-p180@rails31rc4/gems/sass-3.1.2/lib/sass/util.rb:510: [BUG] Segmentation fault | |
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0] |
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
before (:each) do | |
visit new_user_session_path | |
fill_in 'user_login', :with => 'OhMyTest' | |
fill_in 'user_password', :with => 'xix2x3xi' | |
click_button "user_submit" | |
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
class User < ActiveRecord::Base | |
has_many :actions | |
end | |
class Actions < ActiveRecord::Base | |
belongs_to :movie | |
belongs_to :user | |
# add a scope called twitted - it's just a where!!! | |
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
int count = 1; | |
while ( [[NSFileManager defaultManager] fileExistsAtPath:[self filePath]] ) { | |
NSRegularExpression *regex = | |
[NSRegularExpression regularExpressionWithPattern:@"\\s\\(\\d\\)" | |
options:NSRegularExpressionCaseInsensitive | |
error:NULL]; | |
NSString* str = [regex stringByReplacingMatchesInString:self.name | |
options:0 |
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 'twitter' | |
Twitter.configure do |config| | |
config.consumer_key = 'trololol' | |
config.consumer_secret = 'trololol' | |
config.oauth_token = 'trololol-trololol' | |
config.oauth_token_secret = 'trololol' | |
end | |
begin |
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
def self.anual(fc0, fcj, n, d0, dj0) | |
fc0 = fc0.to_f | |
fcj = fcj.to_f | |
dn = dj0 >> n | |
dias = (dn - dj0).to_i | |
cet = 0 | |
while true | |
total = 0.0 | |
n.times do |j| |
OlderNewer