Skip to content

Instantly share code, notes, and snippets.

View fahadgudu's full-sized avatar
😀

Fahad fahadgudu

😀
  • Bitstorm
  • Lahore
View GitHub Profile
@fahadgudu
fahadgudu / RoR_Setup
Created September 26, 2014 05:51
Ruby on Rails Installation and EC2 Server setup
EC2 installation for rails project
sudo apt-get update
sudo apt-get install build-essential libxml2 libxml2-dev libsqlite3-dev locate libssl-dev openssl autoconf
sudo apt-get install curl
\curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
source ~/.profile
rvm requirements
sudo apt-get --no-install-recommends install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev
@fahadgudu
fahadgudu / action_import
Last active August 29, 2015 14:08 — forked from maxivak/00.md
controller do
..
def import
@product = Product.find(params[:id])
# access uploaded file - params[:file]
# do the job
@fahadgudu
fahadgudu / gist:87e768491c7a8edd2bf3
Created November 25, 2014 06:29
Rails server deployment issues
Postgresql: password authentication failed for user “postgres”
$ sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
Done! You saved User = postgres and password = postgres.
If you do not have a password for the User postgres ubuntu do:
$ sudo passwd postgres
Memory issues ans swap areas
@fahadgudu
fahadgudu / Important shell commands
Created December 19, 2014 05:34
some important Work related Commands to know
1- ssh -i ~/Desktop/eventappkey.pem ubuntu@107.22.254.2
2- backup: # mysqldump -u root propelius_production > dumpfilename.sql -p
3- scp -i ~/Desktop/eventappkey.pem ubuntu@107.22.254.2:/home/ubuntu/dumpfilename.sql /home/bilal/Desktop/
4- chmod 600 ~/Desktop/eventapp-test.pem
5- scp -i ~/Desktop/eventapp-test.pem /home/bilal/Desktop/dumpfilename.sql ubuntu@ec2-54-226-196-5.compute-1.amazonaws.com:/home/ubuntu/
# Login as root
ssh root@domain
# Create deploy user
adduser <username> #Adds User with username given. Enter Password when Prompted. Other Details are Optional
# Add user to sudo group
usermod -g <groupname> <username>
# Add .ssh/authorized_keys for deploy user
@fahadgudu
fahadgudu / gist:c3971a72d6af0d0a5153
Last active August 29, 2015 14:28 — forked from ryansobol/gist:5252653
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@fahadgudu
fahadgudu / Galaxy Of Tutorial Torrents
Created April 26, 2016 07:55 — forked from iHassan/Galaxy Of Tutorial Torrents
Ultimate Galaxy Of Tutorial Torrents
=============================
**http://kickass.to/infiniteskills-learning-jquery-mobile-working-files-t7967156.html
**http://kickass.to/lynda-bootstrap-3-advanced-web-development-2013-eng-t8167587.html
**http://kickass.to/lynda-css-advanced-typographic-techniques-t7928210.html
**http://kickass.to/lynda-html5-projects-interactive-charts-2013-eng-t8167670.html
**http://kickass.to/vtc-html5-css3-responsive-web-design-course-t7922533.html
*http://kickass.to/10gen-m101js-mongodb-for-node-js-developers-2013-eng-t8165205.html
*http://kickass.to/cbt-nuggets-amazon-web-services-aws-foundations-t7839734.html
@fahadgudu
fahadgudu / active_admin.rb
Created July 28, 2016 09:00 — forked from fred/active_admin.rb
extend active admin to prettier boolean values
# It extends activeadmin to show pretty boolean values
#
# config/initializers/active_admin.rb
module ActiveAdmin
module Views
class TableFor
def bool_column(attribute)
column(attribute){ |model| model[attribute] ? '&#x2714;'.html_safe : '&#x2717;'.html_safe }
end
@fahadgudu
fahadgudu / active_admin.rb
Created March 22, 2017 04:25 — forked from tinynumbers/active_admin.rb
ActiveAdmin controller extension to persist resource index filters between requests.
# this stuff goes in config/initializers/active_admin.rb
ActiveAdmin.setup do |config|
# ...
# put these lines in the "Controller Filters" section of the ActiveAdmin.setup block
# These two are defined in ActiveAdmin::FilterSaver::Controller, which is loaded below.
config.before_filter :restore_search_filters
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
alias ..="cd .."