Skip to content

Instantly share code, notes, and snippets.

@monicao
monicao / gist:5565307
Created May 12, 2013 23:10
Angular minification settings for the asset pipeline
TestApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
config.assets.digest = true
config.assets.compile = false
config.assets.compress = true
@monicao
monicao / dog.rb
Created March 13, 2013 19:41
An example of instance vs class variables
class Dog
# class variable
@@default_description = "A dog is a furry mammal."
attr_accessor :name
attr_accessor :age
attr_accessor :description
def initialize(name, description)
require_relative "hang_play"
HangPlay.start
require_relative "hangman"
# figure out a random word to use for the game
class HangPlay
# Starts the hangman game
def self.start
@@game = Hangman.new("lemonade")
while true
class Hangman
# This class will be used to run an instance of a hangman game
# It is only concerned with one run through of the game
# It is not responsible for human interaction
attr_accessor :word
attr_accessor :chances
attr_accessor :board
require_relative "hangman"
# figure out a random word to use for the game
class HangPlay
# Starts the hangman game
def self.start
@@game = Hangman.new("lemonade")
self.show_round
end
@monicao
monicao / palindromes.rb
Last active December 14, 2015 17:08
Palindrome problem
# Returns true if sentence is a palindrome.
# racecar ---> true
# hello ---> false
# aba aba ---> true
# Never odd or even ---> true
def palindrome?(sentence)
# downcase the sentence
downcased_sentence = sentence.downcase
# remove all the spaces in the sentence
@monicao
monicao / gist:5102729
Last active December 14, 2015 14:48
Git Cheat Sheet
cd ~/Documents/resume
# if you are using your computer
git config --global user.name "Monica Olinescu"
git config --global user.email "monica.olinescu@gmail.com"
# if you are the imacs
cd ~/Documents/resume
git config user.name "Monica Olinescu"
@monicao
monicao / style.css
Last active December 14, 2015 13:28
body {
margin: 0;
}
nav {
/*padding: 4px 0 8px 0;*/
margin-top: 20px;
width: 100%;
height: 40px;
line-height: 40px;
@monicao
monicao / home.html
Last active December 14, 2015 13:28
<html>
<head>
<title>Things Aaron made</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link href='http://fonts.googleapis.com/css?family=Sintony' rel='stylesheet' type='text/css'>
</head>
<body>
<nav>
<ul>