if @question.set(:deleted => true)
flash[:notice] = render partial: 'notice_undo_delete_question'
redirect_to :back
else
render :edit
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
def create | |
raise "I'm here" | |
build_resource | |
if resource.save | |
// resource is your user | |
@facebookdata = resource.facebook_data.new | |
@facebookdata.likes = "likes" |
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 | |
# here use after create callback | |
# http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html | |
after_create :create_facebookdata | |
def create_facebookdata | |
# do some stuff here | |
self.facebookdata = Facebookdata.new | |
self.facebookdata.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
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session. | |
#[[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator | |
alias rspec='rspec --color --tty --format doc' | |
export EDITOR=vim |
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
doctype | |
html | |
head | |
title Slim is FUN | |
meta charset="utf-8" | |
body | |
#header | |
h1 Cool... header | |
#container | |
#content |
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
Total: connections 27000 requests 26701 replies 26701 test-duration 179.996 s | |
Connection rate: 150.0 conn/s (6.7 ms/conn, <=47 concurrent connections) | |
Connection time [ms]: min 1.1 avg 5.0 max 315.0 median 2.5 stddev 13.0 | |
Connection time [ms]: connect 0.3 | |
Request rate: 148.3 req/s (6.7 ms/req) | |
Request size [B]: 72.0 | |
Reply rate [replies/s]: min 139.8 avg 148.3 max 150.3 stddev 2.7 (36 samples) |
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
Server Software: thin | |
Server Hostname: localhost | |
Server Port: 80 | |
Document Path: /students | |
Document Length: 1204 bytes | |
Concurrency Level: 1 | |
Time taken for tests: 2.371 seconds | |
Complete requests: 1000 |
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
# 2ch image saver written on ruby. | |
# create list.txt and put thread url on each line | |
# sample: | |
# | |
# $ cat list.txt | |
# http://2ch.hk/aa/res/55017.html | |
# http://2ch.hk/aa/res/22059.html | |
# http://2ch.hk/aa/res/40624.html | |
# http://2ch.hk/aa/res/51504.html |
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
$ ab -n 5000 -c 40 http://33467.cirkl.me/ | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 33467.cirkl.me (be patient) | |
................... | |
Finished 5000 requests | |
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
ab -n 1000 -c 40 http://www.indiegogo.com/ | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking www.indiegogo.com (be patient) | |
..... | |
Finished 1000 requests | |
OlderNewer