Skip to content

Instantly share code, notes, and snippets.

Noel Rappin noelrappin

Block or report user

Report or block noelrappin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View accepts_delimited_id_string_for.rb
module AcceptsDelimtedIdStringFor
# accepts_delimited_id_string_for :careers
#
# becomes
#
# def career_id_strings=(delimited_string)
# self.careers = Career.where(:id => delimited_string.split(",")).all
# end
#
View gist:1140408
class Restaurant
attr_accessor :ratings, :cuisine, :price
def initialize(cuisine = nil, price = 0)
@ratings = []
@cuisine = cuisine
@price = price
end
@noelrappin
noelrappin / gist:3717270
Created Sep 13, 2012
Geoffrey Grossenbach's Prompt as a oh_my_zsh theme (see https://peepcode.com/blog/2012/my-command-line-prompt)
View gist:3717270
# Combined left and right prompt configuration.
local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})"
PROMPT='
%~
${smiley} %{$reset_color%}'
RPROMPT='%{$fg[gray]%} $(~/.rvm/bin/rvm-prompt)$(~/bin/git-cwd-info.rb)%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%} (%{$fg[red]%}"
View code_email.md

Hi,

We'd like to continue the application process with you.

For technical candidates, we ask that they submit a solution to a coding challenge. Take a look at this exercise: REDACTED

Here are a few things we'd like you to keep in mind as you work on this problem.

We encourage you to think of this in a real world context, meaning that a client really wants to DO THIS THING, (you can assume the client has a laptop with them and can run arbitrary command-line or web programs). In other words, we want you to solve the problem, not just the algorithm. How will the client run the program? How will the output be presented?

View gist:4676370
Here's a description that is roughly the problem I'm having:
The ember.js site I'm working on has a number of different screens
(deliberately using a word that has no ember connotations).
Let's say, for the sake of argument, 3 of them.
Each of these screens has their own normal route, controller, model,
template structure. This is all standard.
Now I want a dashboard. For the sake of argument, let's say I want
View getting_started.md
@noelrappin
noelrappin / description.md
Last active Dec 14, 2015
Problem I'm having with Ember and Jasmine
View description.md

I'm trying to run an Ember controller in a Jasmine test, and it's giving me some trouble.

This spec works, in that it renders the controller, and most of the controller is rendered accurately and can be tested.

However, there is clearly a difference between how I'm setting up these objects in the test, and how Ember sets them up at run time, because parts of the controller are not working in the test...

Details:

  • The itemController is not accessed at all, which means that the reference to "startDateDisplay" (which is defined in the item controller) comes up empty.
@noelrappin
noelrappin / index_controller_spec.js
Last active Dec 16, 2015
Ember integration test
View index_controller_spec.js
// This is my attempt at an ember controller integration test based on http://jsfiddle.net/ekidd/hCsws/
// It almost works..
// Here's what doesn't work: Template lookup
// In the view description, I have
// template: Ember.TEMPLATES.index
//
// it should be
View profiling.rb
class UnclaimedSlowTestException < Exception
THRESHOLD = 1
def initialize(example)
@example = example
end
def message
"This spec at #{@example.metadata[:location]} is slower than #{THRESHOLD} seconds.
View gist:fe20ee4132bbea9f7c2454cd7bccae52
### Keybase proof
I hereby claim:
* I am noelrappin on github.
* I am noelrap (https://keybase.io/noelrap) on keybase.
* I have a public key whose fingerprint is 9D10 BE61 2831 3E78 345C F8B3 789C 84D0 FC55 9E5B
To claim this, I am signing this object:
You can’t perform that action at this time.