Skip to content

Instantly share code, notes, and snippets.

@chandresh
chandresh / gist:6458958
Last active December 22, 2015 10:28
Installing Ruby using Rbenv on Ubuntu

Step 0 : Pre-requisites

sudo apt-get -y update
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
sudo apt-get -y install git-core
sudo apt-get -y install nodejs
sudo apt-get -y install sqlite3 libsqlite3-dev
@chandresh
chandresh / gist:6458949
Created September 6, 2013 02:51
Installing Ruby on Vagrant:
Installing Ruby on Vagrant:
Open Git Shell
vagrant up
vagrant ssh
Ruby Package Managers:
1. RVM : https://rvm.io
@chandresh
chandresh / gist:6458795
Last active December 22, 2015 10:28
Setup Vagrant

Setup Vagrant

Download:

1. VirtualBox: https://www.virtualbox.org/wiki/Downloads
2. Vagrant: http://www.vagrantup.com/downloads.html
3. Github for Windows: http://windows.github.com
4. Box file: https://github.com/mitchellh/vagrant/wiki/Available-Vagrant-Boxes
http://files.vagrantup.com/precise64.box
@chandresh
chandresh / gist:5914797
Last active December 19, 2015 06:58
Attendance - Advanced
Basic Setup:
- Ability for admin to add employees
- Employees can login & logout as well as "Logout for the day"
* First time (only first time) in the day they login their attendance is marked.
* They can logout & login normally throughout the day.
* When they go home, they need to logout for the day.
- Employees can see their daily attendance on a calendar
- Admin can view all the employees attendance on the calendar
- Admin can view number of hours each employees have worked for in the Calendar.
Class/home work
----------
Continued from last task:
1. Make sure you have only one h1 in your document.
2. Give Color (of your choice) to your page background.
3. h1, h2 apply color.
@chandresh
chandresh / gist:5900494
Created July 1, 2013 12:54
Classwork for HTML Training
Class work
----------
Create your HTML Resume (Fake!)
h1,h2, h3 etc for headings
Put your image somewhere (fake)
Firstname Lastname
1.Create a data structure: student like this with correct syntax:
First Name: “John”
Last Name: “Doe”
Age: 15
Subjects: “Physics”,”Chemistry”,”Maths”
Marks: Physics: 75, Maths: 85, Chemistry:
Create a program to display the information similar to above format
2. Given that you have many strings, write a program to print the 3 longest strings. You can get the strings from the user or start with an array of strings.
Part 2: Ensure that the lines are printed out in decreasing order of length i.e. the output should be sorted based on their length.
@chandresh
chandresh / gist:5891305
Last active January 28, 2016 13:47
Attendance
Basic Setup:
- Ability for admin to add employees
- Employees can login & logout as well as "Logout for the day"
* First time (only first time) in the day they login their attendance is marked.
* They can logout & login normally throughout the day.
* When they go home, they need to logout for the day.
- Employees can see their daily attendance on a calendar
- Admin can view all the employees attendance on the calendar
- Admin can view number of hours each employees have worked for in the Calendar.
@chandresh
chandresh / gist:5881491
Last active December 19, 2015 02:09
Assignment for the class
Class Assignment:
An blog application with 3 types of users:
1. Author can write the article. The article will not show until approved by moderator or admin. Author can edit his own article.
2. Moderator can Read, Approve or Edit.
3. Admin can do everything [Create, Read, Edit, Delete, Approve]. He can create articles in the name of other Authors or admin users [Not a moderator].
##just for playing with twitter api..
1. Create a App at: https://dev.twitter.com/apps/new
2. Get your Credentials
3. gem install 'twitter' or add it to your Gemfile
4. Then you can do something like this (Typically in your initializer):
Twitter.configure do |config|