Skip to content

Instantly share code, notes, and snippets.

JavaScript CodeSchool


Objects

Create a new object

var toilet = new Object();

ActiveRecord Notes


Queries

Create

> User.create(:name => 'jkai', :movie => 'gone with the wind')
@jkaihsu
jkaihsu / css.md
Last active December 17, 2020 03:17

CSS

Basics

Resource: CSS Basics/Basics/111-html-css-css-cascading-style-sheets-360

  1. HTML describes its structures
  2. CSS descrive its presentation

Selector

@jkaihsu
jkaihsu / fibonacci.rb
Created March 7, 2013 08:22
Check, if a number i is part of the Fibonacci sequence.
def is_fibonacci?(i)
sum = [0,1]
x = 0
y = 0
while sum.max <= i
sum.length.times do |a|
x = sum[a] + sum[a-1]
end
@jkaihsu
jkaihsu / guest_list.csv
Last active December 21, 2015 05:39
Automate Adding People to the Guestlist
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
first_name;last_name;email;guests;gender
jkai;hsu
rita;jindawong
fred;tandem
daniella;kaufman
sam;samskies
annie;zhou
jon;oei
christine;hsu
michael;hom
require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = 'EMAIL@provider.com'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }

jQuery and jQuery-ujs

When using Rails 3.0 and later we already get jquery-rails for free. Look in the gemfile and you'll see:

gem "jquery-rails"

You can view the full documentation here: source: https://github.com/indirect/jquery-rails

If you take a look in APP_DIR/app/assets/javascripts/application.js, you'll notice the following lines of code:

Suriving Dev Bootcamp


Remember that Hard Work is more important than talent or intelligence.

Greatness is often misattributed to some finite level of ability. People assume others are ahead of them without accounting for the amount of work that person is putting in to achieve their success.

Persistence and Patience

- patience with yourself and persistence with this process. Learning over completion - You just paid over $12,000 to be here. It's not about checking boxes off of a list, it's about learning the material

JavaScript CodeAcademy

Date: May 8, 2013


1. Intro to Javascript

confirm("I understand the terms")
@jkaihsu
jkaihsu / debugger.md
Last active December 17, 2015 02:48