This file contains hidden or 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
shikeb@psi:~/rails$ git status | |
# On branch master | |
# Your branch is ahead of 'origin/master' by 130 commits. | |
# | |
# Changed but not updated: | |
# (use "git add <file>..." to update what will be committed) | |
# (use "git checkout -- <file>..." to discard changes in working directory) | |
# | |
# modified: .gitignore | |
# modified: Gemfile |
This file contains hidden or 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
shikeb@psi:~/rails$ git stash list | |
stash@{0}: WIP on master: 95fdaf9 Merge branch 'master' of github.com:lifo/docrails | |
shikeb@psi:~/rails$ git stash pop | |
# On branch master | |
# Your branch is ahead of 'origin/master' by 131 commits. | |
# | |
# Changed but not updated: | |
# (use "git add <file>..." to update what will be committed) | |
# (use "git checkout -- <file>..." to discard changes in working directory) | |
# |
This file contains hidden or 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
shikeb@psi:~/rails$ git stash list <--- Nothing in the stash location. | |
shikeb@psi:~/rails$ git stash | |
Saved working directory and index state WIP on master: 95fdaf9 Merge branch 'master' of github.com:lifo/docrails | |
HEAD is now at 95fdaf9 Merge branch 'master' of github.com:lifo/docrails | |
shikeb@psi:~/rails$ git stash list | |
stash@{0}: WIP on master: 95fdaf9 Merge branch 'master' of github.com:lifo/docrails <--- State of the index has been stashed. | |
shikeb@psi:~/rails$ git status | |
# On branch master |
This file contains hidden or 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
This is file |
This file contains hidden or 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
####Before Rails 3.1 | |
class CreateUsers < ActiveRecord::Migration | |
def self.up | |
create_table :users do |t| | |
t.string :name | |
t.string :email | |
t.timestamps | |
end | |
end |
This file contains hidden or 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
#Before Rails 3.1 | |
class CreateUsers < ActiveRecord::Migration | |
def self.up | |
create_table :users do |t| | |
t.string :name | |
t.string :email | |
t.timestamps | |
end | |
end |
This file contains hidden or 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
if(params[:user][:own_organizations_attributes]) | |
params[:user][:own_organizations_attributes][:org_phone_number] = params[:user][:contact_number].to_i | |
resource.own_organizations_attributes = params[:user][:own_organizations_attributes] | |
resource.time_zone = params[:user][:time_zone] | |
end | |
#role membership after create | |
if self.organization.contact_number.nil? | |
self.organization.update_attributes(:contact_number => self.user.contact_number) | |
end |
This file contains hidden or 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
JARS_PATH = File.join(RAILS_ROOT, "lib/jars") | |
Dir["#{JARS_PATH}/*jar"].each {|j| require j} #Suck the jars. | |
require "java" | |
import org.apache.pdfbox.pdfparser.PDFParser | |
import org.apache.pdfbox.pdmodel.PDDocument | |
import org.apache.pdfbox.util.PDFTextStripper | |
import org.apache.poi.extractor.ExtractorFactory | |
#importing all the required classes. |
This file contains hidden or 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
Some more interesting things that I found | |
=========================================== | |
1. Empty array has a hidden boolean value of false | |
arr = [] | |
arr == false // Evaluates to true. | |
/////////////////////////////////////////////////////////////////// | |
2. Concat |
This file contains hidden or 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
var a = 0; | |
a == false // Evalutes to true |