Skip to content

Instantly share code, notes, and snippets.

View ambsvan's full-sized avatar

Amber Spencer ambsvan

View GitHub Profile
@ambsvan
ambsvan / gist:6e287c0d3ed175bbd7df
Created June 3, 2014 19:30
Interactive Ruby (Practice)
* Documentation: https://help.ubuntu.com/
Welcome to your Vagrant-built virtual machine.
Last login: Mon Jun 2 20:21:23 2014 from 10.0.2.2
vagrant [~]> touch hello.rb
vagrant [~]> cd vagrant
-bash: cd: vagrant: No such file or directory
vagrant [~]> ls
git-mania hello.rb index.html ls.txt post.html postinstall.sh tmp work
vagrant [~]> ls
git-mania hello.rb index.html ls.txt post.html postinstall.sh tmp work
@ambsvan
ambsvan / sign.rb
Created June 4, 2014 04:31 — forked from MikaAK/sign.rb
def sign height, width, color = []
total = 0
sqrfeet = height * width
total = sqrfeet * 15
print "Enter your colors seperated with commas: "
color = gets.chomp.split(',').trim
if color.length > 2
total += color.length * 15
else
total += color.length * 10
r = {
"shrimp" => [
"algae",
"other_shrimps",
"seaweed",
],
"toad" => [
"children",
"flies",

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@ambsvan
ambsvan / What is .self?
Created June 9, 2014 22:37
What is .self?
#What is self?
Self can be confusing because it refers to something different depending on the context.
It refers to the object on which it is called (this could be a class or an instance of a class).
In a class, it refers to the class itself, so if a class is called "Person", self is referring to "Person".
In the context of a class, if you call a def (a new method) inside the class without an explicit receiver, it will create a new instance method.
r = {
"shrimp" => [
"algae",
"other_shrimps",
"seaweed",
],
"toad" => [
"children",
"flies",

Setting up the Ruby dev environment on Mavericks

Why would I want to do that?

  • You want to run guard
  • You want use Sublime plugins (like RSpec or Guard plugins)

Installing brew

Brew aka Homebrew is a package management system for Mac OSX.

@ambsvan
ambsvan / 0_reuse_code.js
Last active August 29, 2015 14:13
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