Skip to content

Instantly share code, notes, and snippets.

View stevekinney's full-sized avatar

Steve Kinney stevekinney

View GitHub Profile
.axis path, .axis line {
fill: none;
stroke: black;
shape-rendering: crispEdges;
}
.axis text {
font-family: sans-serif;
font-size: 11px;
}
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
" Vim Plugins via Vundle
@stevekinney
stevekinney / tutorial.md
Last active August 29, 2015 14:05
JavaScript Outside of the Browser (Draft)

JavaScript Outside of the Browser

What is Node?

Node.js is a server-side platform built on Chrome's V8 JavaScript runtime. It uses non-blocking I/O and asynchronous events. It's lightweight, efficient, and commonly used for real-time web applications.

History

Node.js was released by Ryan Dahl in 2009. Ryan didn't set out to create a server-side JavaScript implementation. It was the asynchronous, non-blocking part that he was interested in. Ryan originally tried to accomplish this using C, Lua, and Haskell. Ryan turned his attention to JavaScript when Google open-sourced its V8 JavaScript engine.

// The first thing I want to do is create a Bob constructor for instantiating
// new Bob objects. I don't need to do any initializing, so this is pretty much
// a empty constructor.
function Bob() {};
// I'm going to store all of the functionality in Bob's prototype. This way,
// all of my Bob instances will share the same set of methods.
// Theoretically, I could use a conditional or a switch statement here, but
@stevekinney
stevekinney / ember.md
Created August 20, 2014 17:02
Ember Tasting Notes

Notable features of Ember

The Router

Ember has a super powerful router and the framework strongly emphasizes the importance of URLs. Some other JavaScript frameworks don't update the URL to reflect the current state of the app, this means that the back button doesn't work.

The Object Model

Ember brings in it's own class-based inheritance system with support for super and other goodies.

// The first thing I want to do is create a Bob constructor for instantiating
// new Bob objects. I don't need to do any initializing, so this is pretty much
// a empty constructor.
function Bob() {};
// I'm going to store all of the functionality in Bob's prototype. This way,
// all of my Bob instances will share the same set of methods.
// Theoretically, I could use a conditional or a switch statement here, but

Fundamental SQL: Hands On

Getting Started

Create a folder. sql_intro works if you're at a loss for something better.

Fire up SQLite: sqlite3 example.sqlite3

Let's create a new table.

@stevekinney
stevekinney / ruby-resources.md
Created August 28, 2014 13:38
Ruby Learning Resources

Learn to Program

This is a great introductory book. It's really the only "traditional" book I am recommending at this stage in the game. It's a bit old, but it's free to read online.

Try Ruby

Try Ruby is an interactive tour of Ruby. It gives you a command prompt like the one we were fucking around with yesterday and takes your through some of the basic functionality of Ruby. It takes about 20 minutes and it's totally worth it. Don't worry about remembering everything and feel free to do it again in a few weeks.

Learn Ruby the Hard Way

Environment Setup

  • Homebrew
    • OS X Command Line Development Tools
  • Git brew install git
  • RVM
  • Ruby (via RVM)
  • Atom
  • Seeing is Believing
  • Pry
# Not Good
def show
  @order = Orders.find(params[:id])
end

# Good:
#@user is the logged on user.
def show
 @order = @user.orders.find(params[:id])