Rafael lastk

View gist:7845935
1 2 3 4 5 6 7 8 9 10
###################
# compiled source #
###################
*.com
*.class
*.dll
*.exe
*.pdb
*.dll.config
*.cache
View gist:5137665
1 2 3 4 5 6 7 8 9 10
$(document).ready(function() {
 
if ($("[name='search']").length) {
$("[name='search']").each(function() {
var search = new Search.Input(this);
search.setBindings();
});
}
 
});
View gist:2413388
1 2 3 4 5 6 7 8 9 10
class ReceivablesManagementContext
def initialize(params)
@params = params
end
 
def save_receivable
sanitize_controller_params
@receivable = AccountReceivable.new(@params[:account_receivable])
@receivable.customer_id = @params[:customer_id]
@receivable.save
View gist:2407839
1 2 3 4 5 6 7 8 9 10
class PostCommitmentContext
#how we're using ruby/rails I thought in something like a rubygem and have a 'config' file in other place.
twitterable[:twitterFollower,:twitterPoster]
def initialize(params)
@params = params
end
 
def save
View gist:2407666
1 2 3 4 5 6 7 8 9 10
class PostCommitmentContext
def initialize(params)
@params = params
end
 
def save
@post = Post.new(@params)
if @post.save
# @post é ActiveRecord, então não há o que extender mesmo porque ActiveRecord já está encruado
Twitter.send_notification({login: "login",pass:"password"},@post.title)
View macenv.rb
1 2 3 4 5 6 7 8 9 10 11 12
#!/usr/bin/env ruby
 
PASS_THROUGH = %w(PATH MANPATH EDITOR)
DIRECTORY = File.expand_path('~/.MacOSX')
FILENAME = File.join(DIRECTORY, 'environment.plist')
Dir.mkdir(DIRECTORY) unless File.exist?(DIRECTORY)
 
HEADER = <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
View gist:1075145
1 2 3 4 5 6 7 8 9 10
=form_for(@user_session,:url=>"/sessions",:method=>"post") do |f|
.field
=f.label :credential
=f.text_field :credential
 
.field
= f.label :password
= f.text_field :password
 
.field.actions
View application.html.erb
1 2 3 4 5 6
<!-- layout file -->
<% if current_user %>
Welcome <%= current_user.username %>. Not you? <%= link_to "Log out", logout_path %>
<% else %>
<%= link_to "Sign up", signup_path %> or <%= link_to "log in", login_path %>.
<% end %>
View inspect.js
1 2 3 4 5 6 7 8 9 10
function escapeString(string) {
string = string.replace(/\\/g, "\\\\").
replace(/\n/g, "\\n").
replace(/\r/g, "\\r").
replace(/\t/g, "\\t");
if (string.indexOf("'") < 0) {
return "'" + string + "'";
}
string = string.replace(/"/g, "\\\"");
return '"' + string + '"';
View robot.rb
1 2 3 4 5 6 7 8 9
module Robot
 
def self.attr_state(*names)
names.each{|n|
n = n.to_sym
attr_writer n
attr_reader n
}
end
Something went wrong with that request. Please try again.