Skip to content

Instantly share code, notes, and snippets.

View tmehta2442's full-sized avatar

Tejas Mehta tmehta2442

View GitHub Profile
{
"title": "The Basics - Networking",
"description": "Your app fetched this from a remote endpoint!",
"movies": [
{ "title": "Star Wars", "releaseYear": "1977"},
{ "title": "Back to the Future", "releaseYear": "1985"},
{ "title": "The Matrix", "releaseYear": "1999"},
{ "title": "Inception", "releaseYear": "2010"},
{ "title": "Interstellar", "releaseYear": "2014"}
]
user = User.find(1)
about 2 hours ago
Daniel Draper
user.events
about 2 hours ago
You
rails server -b $IP -p $PORT
about an hour ago
Daniel Draper
e = Event.last
@tmehta2442
tmehta2442 / Refactoring
Created October 28, 2013 20:17
Refactoring ideas for codemapsalpha
- Views, Offline_schools: index.html.erb
maybe move the js files into assets->javascripts
- Views, offline_schools: new.html.erb
maybe move the js files into assets->javascripts
- Views, offline_schools: show.html.erb
maybe move the js files into assets->javascripts
Ordinarily, JS functions should be placed in the assets-> javascripts folder. From my experience, moving the JS into the appropriate assets folder is relatively easy (even if it includes AJAX). Note that the <script> & </script> tags are not needed. A great helper:
TogsMacBookAir:groupgoc Tejaslog$ gem list
*** LOCAL GEMS ***
actionmailer (4.0.0, 3.2.14)
actionpack (4.0.0, 3.2.14)
activemodel (4.0.0, 3.2.14)
activerecord (4.0.0, 3.2.14)
activerecord-deprecated_finders (1.0.3)
activeresource (3.2.14)
require 'typhoeus'
require 'json'
require 'yaml'
class FindmoviesController < ApplicationController
def index
@movie_id = MovieId.all
end
puts "would you lke to start a contact list?"
response = gets.chomp
hash = {}
while response == "y"
puts "give me name"
name = gets.chomp
puts "number"
number = gets.chomp
hash[name] = number
# Building Ruby Familiarity
# In this exercise you will take a first look at some common commands in Ruby
# The idea here is to build familiary with Ruby syntax
# This will likely be the first time you've seen some of these commands
# Just type them in and see the displayed output
# Steps:
# 1. Open up a new terminal window
# 2. Launch irb
@tmehta2442
tmehta2442 / ruby.rb
Created September 23, 2013 20:50
my gist, I guess
def yoyo
puts "yoyo"
end