Skip to content

Instantly share code, notes, and snippets.

View faizaanshamsi's full-sized avatar

Faizaan Shamsi faizaanshamsi

  • Las Vegas, NV
View GitHub Profile
@faizaanshamsi
faizaanshamsi / Change Machine
Created November 21, 2013 16:47
#Assuming amount tendered is greater or equal to amount due #Does not format output to 2 decimals #Assumes inputs are in 2 decimal or less format
change = {
:dollars => 100,
:quarters => 25,
:dimes => 10,
:nickels => 5,
:pennies => 1
}
puts "What is the amount due?"
amount_due = gets.chomp.to_f
change_types = {}
@faizaanshamsi
faizaanshamsi / assignment_grade.rb
Last active December 30, 2015 01:49
A OO program that reads in a csv of students and grades, and allows a report to be generated for student and classroom grade averages.
# Grade, contains the name of the assignment and the score
class AssignmentGrade
attr_accessor :numeric_grade, :assignment
def initialize(assignment, grade)
@assignment = assignment
@numeric_grade = grade.to_f
end
end
@faizaanshamsi
faizaanshamsi / pig.rb
Created December 5, 2013 19:53
pig latin translator
class PigLatinTranslation
def initialize(phrase)
@phrase = phrase
end
#provide the pig latin translation
def translate
@words = words
@words.collect! do |word|
if starts_with_vowel?(word)
@faizaanshamsi
faizaanshamsi / .rspec
Created December 5, 2013 20:46
Pig Latin Translator and Tests
--color
@faizaanshamsi
faizaanshamsi / gist:8049209
Created December 20, 2013 01:40
pgexercise.com exercises completed.
http://pgexercises.com/questions/basic/selectall.html
http://pgexercises.com/questions/basic/selectspecific.html
http://pgexercises.com/questions/basic/where.html
http://pgexercises.com/questions/basic/where2.html
http://pgexercises.com/questions/basic/where3.html
http://pgexercises.com/questions/basic/where4.html
@faizaanshamsi
faizaanshamsi / 0_reuse_code.js
Created December 30, 2013 15:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@faizaanshamsi
faizaanshamsi / css_resources.md
Created December 30, 2013 15:51 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@faizaanshamsi
faizaanshamsi / 0_reuse_code.js
Created February 19, 2014 16:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@faizaanshamsi
faizaanshamsi / Aliasing.md
Last active February 13, 2017 15:30
Creating Aliases for ZSH
  1. Open your .oh-my-zsh file in Sublime: subl ~/.oh-my-zsh

  2. Find lib/aliases.zsh

  3. Add aliases in the following manner: alias [shortcut]='[what you would type into terminal]'


alias ohmyzsh='subl ~/.oh-my-zsh'
alias programs='cd ~/dropbox/programs'
@faizaanshamsi
faizaanshamsi / Burgers.rb
Created May 29, 2014 13:35
Each and Map
require 'pry'
array = [1,2,3]
class Array
def hamburger(&block)
i = 0
while i < self.length
yield(self[i])
i += 1