Skip to content

Instantly share code, notes, and snippets.

View pitosalas's full-sized avatar

Pito Salas pitosalas

View GitHub Profile
Processing PlansController#index (for 24.61.84.158 at 2012-03-02
17:53:48) [GET]
Session ID: 3105294042126eab3c6292d3ba224847
Parameters: {"controller"=>"plans", "action"=>"index"}
Rendering layoutfalseactionlist within layouts/standard
Rendering plans/list
Completed in 0.18974 (5 reqs/sec) | Rendering: 0.10813 (56%) | DB:
0.03900 (20%) | 200 OK [http://admin.blogbridge.com/]
file /tmp/ruby_sess.5684ebd33a502d9d not readable
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/pstore.rb:100:in
class ProgramServices
def initialize program
@prog = program
@result_code = nil
end
def smart_add_participant u_name, u_email, u_password
usr = find_or_add_user(u_name, u_email, u_password)
add_participant(usr)
@result_code
@pitosalas
pitosalas / gist:5454177
Created April 24, 2013 18:06
This is a simple bit of code that I think is ugly. I am looking for a suggestion on making it more idiomatic. Thanks!
def populate_todolist
progs = @user.participating_programs
@to_do_list = progs.map { |prog| build_todolist_row(prog) }
@to_do_list.compact!
end
# return nil if analysis yields no todolist row. compact! above removes the nil.
def build_todolist_row prog
rounds = prog.open_rounds
raise "more than one round open in ToDoList" if rounds.length > 1
Panic (system crashes) log:
Source: /Library/Logs/DiagnosticReports/Kernel_2013-07-25-133229_monster-6.panic
Size: 9 KB (8,803 bytes)
Last Modified: 7/25/13 1:32 PM
Recent Contents: Thu Jul 25 13:32:29 2013
Machine-check capabilities 0x0000000000001c09:
family: 6 model: 26 stepping: 5 microcode: 17
Intel(R) Xeon(R) CPU W3520 @ 2.67GHz
9 error-reporting banks
# Note to Ken: Interestng, you assume that the records after 8000 are test
# Also you add the 'test data' into both the base and the test set.
# Neither one is wrong, but they are assumptions that go beyond the specification. No need to fix.
def load_base_dataz
counter = 0
File.open(@base_path, "r").each_line do |line|
split_line = line.split # user_id, movie_id, rating, time_stamp
if counter < 80000 # read in base data first
(byebug) next
/Users/pitosalas/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/amq-protocol-2.0.1/lib/amq/protocol/client.rb:492: warning: assigned but unused variable - offset
/Users/pitosalas/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/amq-protocol-2.0.1/lib/amq/protocol/client.rb:558: warning: assigned but unused variable - offset
/Users/pitosalas/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/amq-protocol-2.0.1/lib/amq/protocol/client.rb:765: warning: assigned but unused variable - offset
/Users/pitosalas/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/amq-protocol-2.0.1/lib/amq/protocol/client.rb:835: warning: assigned but unused variable - offset
/Users/pitosalas/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/amq-protocol-2.0.1/lib/amq/protocol/client.rb:885: warning: assigned but unused variable - offset
/Users/pitosalas/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/amq-protocol-2.0.1/lib/amq/protocol/client.rb:939: warning: assigned but unused variable - offset
/Users/pitosalas/.rbenv/versions/2.3.1
{
"version": 1,
"variables": [
{
"names": [
"path"
],
"values": [
[
"/?x=6026"
{
"version": 1,
"variables": [{
"names": ["login"],
"values": [
[
"user_id=7042"
],
[
"user_id=7204"
@pitosalas
pitosalas / gist:033456da51039066f911fca0fd6f01a0
Created April 9, 2019 18:27
Official loader.io payload file
{
"version": 1,
"variables": [{
"names": ["login"],
"values": [
[
"user_id=7042"
],
[
"user_id=7204"
# routes.rb
get :show_form, to: 'users#show_form'
get :do_form, to: 'users#do_form'
# added to users_controller.rb
# GET /show_form
def show_form
end
# GET /do_form