Skip to content

Instantly share code, notes, and snippets.

View jkonowitch's full-sized avatar

Jeffrey Konowitch jkonowitch

  • New York
View GitHub Profile
@jkonowitch
jkonowitch / combine.coffee
Created January 9, 2012 02:47
Array Combine - No Duplicates
###
This algorithm merges any items in arr2 that are not already present in the array arr1
It also first screens arr2 for any duplicates before checking against arr1
###
combineArrays = (arr1, arr2) ->
if arr1.length isnt 0 or arr2.length isnt 0
for item, index in arr2
for j in [index+1...arr2.length]
if item is arr2[j] then arr2.splice(j,1)
@jkonowitch
jkonowitch / sign_in_user.rb
Created June 25, 2012 15:31
sign_in_user
class SessionController < ApplicationController
def create
user = User.find_by_email(params[:session][:email])
if user && user.authenticate(params[:session][:password])
sign_in user
redirect_to user
else
redirect_to sign_in_path
end
end
@jkonowitch
jkonowitch / Gruntfile.js
Created June 13, 2013 22:19
Sample GruntFile
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
module.exports = function (grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
@jkonowitch
jkonowitch / gist:6644109
Created September 20, 2013 21:20
dotfile
eval "$(rbenv init -)"
PATH=$HOME/bin:$PATH
# =================
# Bash Prompt
# =================
# --------------------
# Colors for the prompt
# --------------------

Installing Tools

  1. [HipChat][hipchat]
  • [Upgrade to OS X Mountain Lion][osx]
  • [Xcode][xcode]
    1. Xcode Command Line Tools
  • [Google Chrome][chrome]
  • [Install Homebrew][brew]
    • Then: brew install git rbenv ruby-build rbenv-gem-rehash postgres
  • [Install Ruby + Rails]
# =================
# Rbenv
# =================
eval "$(rbenv init -)"
# =================
# Path
# =================
PATH=$HOME/bin:$PATH
@jkonowitch
jkonowitch / gist:6664550
Created September 22, 2013 22:40
.gitconfig
# http://git-scm.com/book/en/Getting-Started-First-Time-Git-Setup
[user]
name = My Name
email = [email protected]
[color]
ui = true
[alias]
st = status -sb -uall
[core]
editor = subl
@jkonowitch
jkonowitch / gist:6664554
Created September 22, 2013 22:41
.gitignore-global
# https://help.github.com/articles/ignoring-files
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
@jkonowitch
jkonowitch / gist:6664557
Created September 22, 2013 22:41
sublime-prefs
{
"color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
"font_face": "Inconsolata",
"font_size": 18.0,
"tab_size": 2,
"translate_tabs_to_spaces": true
}
  1. After you've signed up for a GitHub account please follow the instructions in this article to get your ssh-keys setup: https://help.github.com/articles/generating-ssh-keys

  2. Make sure you've got ~/dev and ~/dev/wdi folders set up. (Use mkdir in the terminal to do this!)

  3. cd into your ~/dev/wdi folder and run:

  • git clone https://github.com/ga-students/WDI_NYC_Array
  1. Go to the GAInstallFest app repository and follow the instructions to get setup. (I will send the API keys you need in the email)

  2. We have 1:1s starting this week. See the schedule