Skip to content

Instantly share code, notes, and snippets.

View screamingmunch's full-sized avatar

Kristine screamingmunch

  • Dictionary.com
  • San Francisco, CA
View GitHub Profile
@screamingmunch
screamingmunch / camera_json_lab.rb
Created June 20, 2013 03:50
Wk1_Wed(Day3) Lab Assignment
#!/usr/bin/env ruby
require 'open-uri'
require 'json'
#original gist: https://gist.github.com/bridgpal/e032c851cebf6de1a968
url = "https://gist.github.com/bridgpal/e032c851cebf6de1a968/raw/820ef8ca253e9aaf986c010e235ef1141564fedc/products.json"
result = JSON.parse(open(url).read)
items = result["items"] #items array
# 1. Print out the size of items returned
@screamingmunch
screamingmunch / Wk1_Wed(Day3).md
Last active December 18, 2015 17:09
GA- Ruby Arrays, Loops, Hashs

We spent most lecture today on arrays & hashes. AJ demonstrated creating a hash from a .csv file containing all the teaching staff's names and contact info. We had our first lab today as well, sorting through a json file of search results to manipulate the data and perform searches. I learned that you can create hashes within hashes, and even within arrays. For example: Items[3]["products"]["price"]. To find whether there is a match of a string (or regular expression) to your larger string (or hash/array/.json file), use: array["name"] =~ /Jay/

tl;dr Arrays, Loops, Hashes..

Getting files from Terminal:

j@ubuntu:~$ mkdir Code/wk1d3
@screamingmunch
screamingmunch / Wk1_Tue(Day2).md
Last active December 18, 2015 15:49
GA Lecture Notes

tl;dr: Ruby Arrays,

Objectives:MVC & Testing , Arrays & Functions ,Networking & HTTP

Ruby "Strings" vs. [Arrays]

    array: an Object with ordered storage container
```Ruby names = ["Travis", "Megan", "Tod", "Bryan"] #literal array- what you see is what you get, also json (JS object notation)
@screamingmunch
screamingmunch / Wk1_Mon(Day1).md
Last active December 18, 2015 14:49
Terminal Commands, Shebang, #!/usr/bin/env ruby, chmod, cat, less

Day 1 of GA WDI program: we spent majority of the class in terminal(shell), getting comfortable with command line prompts. We also played with some Ruby in and Sublime Text. All in all, a good review of all the prep work on command line stuff. Ubuntu isn't as scary as when I first installed it yesterday.

tl;dr: Terminal Commands, Shebang #!/usr/bin/env ruby, chmod a+x demo.rb , Literals, cat, less.

file_name.md --> md stands for markdown file type

Linux:

Ctrl + to zoom in (in apple: Cmd +)

@screamingmunch
screamingmunch / HTML
Created March 30, 2013 23:06
HTML rails
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body{
margin: 0;
}
h1{
color: navy;