Skip to content

Instantly share code, notes, and snippets.

View mcsuth's full-sized avatar

Seimith Suth mcsuth

View GitHub Profile
@mcsuth
mcsuth / 0_reuse_code.js
Last active August 29, 2015 14:14
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
O(1) - Constant time
"Get the first value of a list"
"Random sample from a list"
O(logN) - Divide and Pick
Typical of algorithms that divide the input, then look at one of the sections
Searching sorted data
O(N) - For each ....
Sum an array

CS WEEK: Data Structures

Intro to Linked Lists and Trees

  • What is Computer Science?
    • Types of knowledge
  • Why Data Structures?
    • Background Checkpoint
      • What are some familiar data structures…
      • What are some means of combination…
      • What are some means of abstracting…
@mcsuth
mcsuth / W07D01HW
Created November 5, 2013 02:05 — forked from wcargen/W07D01HW
Magic 8-Ball Homework - Monday, Nov. 4th, 2013
This homework is a way to learn more about things we covered today in class. We talked about ActiveRecord relations and join tables. We also talked about CoffeeScript.
The objective for this assignment is to create a single page app that uses 3 models, Question, Answer, & AnsweredQuestion. There should be a has_many and has_many:through association between your models.
Use a seed file to put answers into your database. Please see seed file below, which has been typed out to spare you the pain of that :)
CoffeeScript will be used to implement the application's front-end logic and for making the AJAX post request.

Coffee-Script lab

Hater's lab

Objective
To reinforce skills familiar in javascript regarding DOM interaction, and successfully translate them into Coffee-Script.

Coffee-Script lab

Hater's lab

Objective
To reinforce skills familiar in javascript regarding DOM interaction, and successfully translate them into Coffee-Script.
Please write some tests for your first Project. This is backwards from the way it "should" be
-- haha, some Rspec humor for ya!!
Make sure to include at least one Model test and one Controller test. These are tests for
your Ruby code only.
I will randomly call on students in each class to describe the tests they wrote and why, so
please do your homework! :)
Tomorrow we will learn about testing in JavaScript. If you want to do some reading up ahead
rails g UserMailer
class UserMailer < ActionMailer::Base
default from: "[email protected]"
def confirm_user(user)
@user = user
@url = 'http://fred.com/login'
mail(to: @user.email, subject: 'Welcome to Fred Site')
end
@mcsuth
mcsuth / index.md
Created October 21, 2013 23:11 — forked from rstacruz/index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

<script>
function doSomething(){
var todo = $.Deferred();
$.when("")
.then(function(){
setTimeout(function(){
alert("Our First Thing is Done!!")
}, 500)