Skip to content

Instantly share code, notes, and snippets.

@mizanRahman
mizanRahman / git-setup.sh
Last active December 16, 2015 17:40
Ruby On Rails environment setup on linux (ubuntu)
##install git
sudo apt-get install git
##configure git for commit info
git config --global user.name "Mizan Rahman"
git config --global user.email mizan.cse.buet@gmail.com
##configure github
git config --global github.user mizanRahman
@mizanRahman
mizanRahman / heroku-setup.sh
Last active December 16, 2015 21:19
remote repository setup
#setup/manage ssh key------------------------------------------
##https://devcenter.heroku.com/articles/keys
#To generate a public key:
ssh-keygen -t rsa
#to add the key
heroku keys:add
#to see all available remotes
git remote -v
@mizanRahman
mizanRahman / rails-heroku.sh
Last active December 16, 2015 22:19
rails-heroku
rails new test_app
cd test_appli
git init
git add .
git commit -m "initial commit"
heroku create --stack cedar
git push heroku master
heroku run rake db:migrate
@mizanRahman
mizanRahman / Rakefile
Created May 16, 2013 11:05
rake task to sync your source files to github
desc "commit source to github"
task :sync do
puts "syncing source files to github"
system "git add ."
puts "\n## Commiting: Site updated at #{Time.now.utc}"
message = "Site updated at #{Time.now.utc}"
system "git commit -m \"#{message}\""
puts "\n## Pushing source files"
system "git push origin source"
puts "\n##Source Sync completed"
@mizanRahman
mizanRahman / Rakefile
Last active December 17, 2015 10:28
common tasks for heroku deployment and source-controlling with github and bitbucket
#!/usr/bin/env rake
remote_repos = {
"github" => "github",
"bitbucket" => "origin"
}
deploy_remotes = {'heroku'=>"heroku"}
<% @profile.errors.full_messages.each do |msg| %>
<p class="alert"><%= msg %></p>
<% end %>
@mizanRahman
mizanRahman / git-commands.md
Last active December 17, 2015 16:29
handy git commands

###to discard unstaged changes

git checkout .
git checkout <filename>

to unstage the staged changes

git reset HEAD <filename>

###to remove unstagged changes

@mizanRahman
mizanRahman / ruby-install-mac.sh
Created June 5, 2013 23:08
ruby install script for mac
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew install ruby
@mizanRahman
mizanRahman / gemlist.md
Created June 6, 2013 23:27
important gems list

#Important gems list

##Production

##Development

##test

  • rspec
  • guard
@mizanRahman
mizanRahman / fogdemo.rb
Created June 7, 2013 18:15
using amazon s3 file storage with fog
require 'rubygems'
require 'fog'
# create a connection
connection = Fog::Storage.new({
:provider => 'AWS',
:aws_access_key_id => YOUR_AWS_ACCESS_KEY_ID,
:aws_secret_access_key => YOUR_AWS_SECRET_ACCESS_KEY
})