Skip to content

Instantly share code, notes, and snippets.

View Jimgerneer's full-sized avatar

Jim Denton Jimgerneer

  • Blinker
  • Denver
View GitHub Profile
@Jimgerneer
Jimgerneer / Color
Created January 9, 2012 05:11
How we see color
Without light there would be no color. Everything we look at is actually reflecting certain wavelengths of light and then absorbing the rest. The wavelength colors that our eyes can process are a part of the visible spectrum, a tiny sliver of the electromagnetic spectrum. The principle colors are, violet, blue, green, yellow, orange, and red. All light that we can see exists between the rainbow of violet on one end and red on the other.
Once light reflects off an object the wavelengths that weren’t absorbed make it into our eye. The lens focuses the light onto the retinal area that is made up of nerve endings called rods and cones. Rods are only sensitive to intensity or brightness. Color sensitive cones come in three types: the first is more sensitive to red, the second to blue and the third to green. These nerve endings turn light into electrochemical signals that are sent down the optical nerve to the brain. Then based on what is receive the brain interprets the signals and gives us sight.
@Jimgerneer
Jimgerneer / macvimfailedmake
Created March 21, 2012 16:34
Error installing macvim Xcode 4.3
==> Downloading https://github.com/b4winckler/macvim/tarball/snapshot-64
Already downloaded: /Users/Inkpen1986/Library/Caches/Homebrew/macvim-7.3-64.tgz
/usr/bin/tar xf /Users/Inkpen1986/Library/Caches/Homebrew/macvim-7.3-64.tgz
==> ./configure --with-features=huge --with-tlib=ncurses --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-tclinterp
./configure --with-features=huge --with-tlib=ncurses --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-tclinterp
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
@Jimgerneer
Jimgerneer / brewconfig
Created March 21, 2012 22:54
brew config
HOMEBREW_VERSION: 0.9
HEAD: d308e2098b7b2bb894a2e970b0a6477b97ff5814
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit sandybridge
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.3.1
GCC-4.0: N/A
GCC-4.2: build 5666
BACKTRACE
(expand)
JUMP TO: GET POST COOKIES ENV
/Users/Inkpen1986/Fountain/Ruby/Rook/views/index.haml in evaluate_source
= will_paginate @opportunites
/Users/Inkpen1986/Fountain/Ruby/Rook/routes/opportunity.rb in block in <class:Rook>
haml :index
GET
No GET data.
POST
@Jimgerneer
Jimgerneer / opportunity_spec.rb
Created June 2, 2012 00:02
Opportunity spec
1 require_relative '../spec_helper'¬
2 require_relative '../../models/user'¬
3 ¬
4 describe Rook::User do¬
5 before do¬
6 @user = Rook::User.gen¬
7 end¬
8 ¬
9 it 'has a username' do¬
10 @user.username.must_equal 'DecoyDrone'¬
# NAME: authinabox
# VERSION: 1.01 (Dec 27, 2008)
# AUTHOR: Peter Cooper [ http://www.rubyinside.com/ github:peterc twitter:peterc ]
# DESCRIPTION: An "all in one" Sinatra library containing a User model and authentication
# system for both session-based logins OR HTTP Basic auth (for APIs, etc).
# This is an "all in one" system so you will probably need to heavily tailor
# it to your own ideas, but it will work "out of the box" as-is.
# COMPATIBILITY: - Tested on 0.3.2 AND the latest rtomayko Hoboken build! (recommended for the latter though)
# - NEEDS DataMapper!
# - Less work needed if you use initializer library -- http://gist.github.com/40238
@Jimgerneer
Jimgerneer / user.rb
Created June 5, 2012 03:54
Models/user and routes/user
require_relative '../rook'
class Rook::User
include DataMapper::Resource
attr_accessor :password, :password_confirmation
property :id, Serial, :writer => :protected, :key => true
property :email, String, :required => true, :length => (5..40),
:unique => true, :format => :email_address
class Booking
include DataMapper::Resource
property :id, Serial
belongs_to :booked_user, :model => 'User', :child_key => [:user_id]
belongs_to :booked_opportunities, :model => 'Opportunity', :child_key => [:opportunity_id]
end
@Jimgerneer
Jimgerneer / gist:3814837
Created October 1, 2012 22:26
Rook Beta Draft 1

Welcome to Rook.

What is Rook?

This is my Apprenticeship Thesis project. It is a Sinatra open source project I have been doing on the side to hone my skills as a Ruby apprentice. The idea is for those with knowledge to create learning opportunities. Whether it be pairing on a kata in Ruby or a whole course in Common Lisp I want to make it easier for people to offer their time/skills and easier for people to find those opportunities.

Potential Mentees:

Where do you start? Everyone has a different learning style. Rook is shaped on my preferred style, learning by doing. I started to learn Ruby at the beginning of this year. After a month buried in books and tutorials, I didn't know what to do, I needed direction, a harness for my newly found love of programming. I made a post on Reddit and asked the question, "How did you get your first job developing Ruby?". They first directed me to find local user groups which is rock solid advice I pass on to everyone I know starting out. Then they did something I was n

@Jimgerneer
Jimgerneer / Report.rb
Created December 24, 2012 19:56
Attempts at scope
1 class Report < ActiveRecord::Base¬
2 attr_accessible :user_id, :evidence, :location, :time, :perpetrator_id, :new_perpetrator, :bounty, :active¬
3 attr_accessor :new_perpetrator¬
4 ¬
5 before_validation :create_new_perpetrator¬
6 ¬
7 belongs_to :perpetrator¬
8 belongs_to :user¬
9 ¬
10 scope :active, where(active: true)¬