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
$(document).ready(function() { | |
$('.pagination a').live('click',function (){ | |
$.getScript(this.href); | |
return false; | |
}); | |
}); |
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
For doing push/pull as below: | |
git pull unfuddle master | |
git pull heroku master | |
git push unfuddle master | |
git push heroku master | |
========================== | |
vim .git/config | |
========================== | |
[core] |
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 KeyGenerator | |
require "digest/sha1" | |
def self.generate(length = 10) | |
Digest::SHA1.hexdigest(Time.now.to_s + rand(12341234).to_s)[1..length] | |
end | |
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
require 'grape' | |
module My | |
class API < Grape::API | |
prefix 'api' | |
## params key list | |
################################################################################################################# | |
# 1. login | |
# 2. sign |
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
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="400" height="375" id="FlvPlayer" align="middle"> | |
<param name="allowScriptAccess" value="sameDomain" /> | |
<param name="allowFullScreen" value="true" /> | |
<param name="movie" value="http://flvplayer.com/free-flv-player/FlvPlayer.swf" /> | |
<param name="quality" value="high" /> | |
<param name="bgcolor" value="FFFFFF" /> | |
<param name="FlashVars" value="flvpFolderLocation=http://flvplayer.com/free-flv-player/flvplayer/&flvpVideoSource=http://andy.local:3000/video/safeway_screencast.flv&flvpWidth=400&flvpHeight=375&flvpInitVolume=50&flvpTurnOnCorners=true&flvpBgColor=FFFFFF" | |
<embed src="http://flvplayer.com/free-flv-player/FlvPlayer.swf" flashvars="flvpFolderLocation=http://flvplayer.com/free-flv-player/flvplayer/&flvpVideoSource=http://andy.local:3000/video/safeway_screencast.flv&flvpWidth=400&flvpHeight=375&flvpInitVolume=50&flvpTurnOnCorners=true&flvpBgColor=FFFF |
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
$ screen -ls | |
There is a screen on: | |
4491.pts-2.FC547 (Attached) | |
1 Socket in /var/run/screen/S-sathiya. | |
$ screen -r 4491.pts-2.FC547 | |
[4491.pts-2.FC547 detached.] |
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
Just run below command to solve it. | |
git config core.autocrlf false |
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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
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 export_to_csv | |
@users = User.find(:all) | |
csv_string = CSV.generate do |csv| | |
# header row | |
csv << ["id", "first_name", "last_name"] | |
# data rows | |
@users.each do |user| | |
csv << [user.id, user.first_name, user.last_name] | |
end |