Skip to content

Instantly share code, notes, and snippets.

View msadoon's full-sized avatar
:shipit:

Mubarak Sadoon msadoon

:shipit:
  • Toronto, ON
View GitHub Profile
@msadoon
msadoon / helps_controller.rb
Last active August 29, 2015 14:03
updating one record in a db
def update
d { @help }
respond_to do |format|
if @help.update(help_params)
format.html { redirect_to @help, notice: 'Help was successfully updated.' }
format.json { render :show, status: :ok, location: @help }
#redirect_to action: "index"
else
format.html { render :edit }
format.json { render json: @help.errors, status: :unprocessable_entity }
@msadoon
msadoon / ls-la
Created June 25, 2014 17:51
pdftk binary not executing in heroku dynp bash env
~ $ ls
app db heroku_key.txt.pub public ruby-versions.yml
bin Gemfile lib Rakefile test
config Gemfile.lock log README.md tmp
config.ru heroku_key.txt my_log.txt README.rdoc vendor
~ $ cd bin
~/bin $ ls -la
total 21652
drwx------ 3 u22794 22794 4096 2014-06-25 17:49 .
drwx------ 14 u22794 22794 4096 2014-06-25 17:50 ..
@msadoon
msadoon / buildings_controller.rb
Last active August 29, 2015 14:02
ajax request success template missing
def getgst
d { 'gets fired' }
s = Building.get_gst_for_building(params[:buildinginfo])
d { s.to_s('F') }
@var = s.to_s('F')
respond_to do |format|
format.html { render :text => @var.html_content }
end
@msadoon
msadoon / tictactoe.rb
Created May 16, 2014 16:09
a little console base tictactoe game I wrote in Ruby.
#init variables
endcase = 0
moveNum = 0
$firstmove = 0
$a,$b,$c,$d,$e,$f,$g,$h,$i = "?", "?", "?", "?", "?", "?", "?", "?", "?"
$v = "?"
def reset(a,b,c,d,e,f,g,h,i)
system('clear')