Skip to content

Instantly share code, notes, and snippets.

View nemrow's full-sized avatar

Jordan Nemrow nemrow

  • Woflow
  • San Francisco
View GitHub Profile
aahed
aalii
aargh
abaca
abaci
aback
abada
abaff
abaft
abaka
def farked?(dice_array)
puts "farked" if has_3_of_kind?(dice_array) || has_1?(dice_array) || has_5(dice_array)
end
def has_1?(dice_array)
dice_array.include?(1)
end
def has_5?(dice_array)
dice_array.include?(1)
def create
Project.create(project_params)
end
class ProjectsController < ApplicationController
uses_ripped_params :project_params
end
# lib/ripped_params/project_params.yml
---
:require: :project
:permit:
- :name
- :service_id
- :quote
- :document_attributes:
- :filepicker_url
class ProjectsController < ApplicationController
def create
Project.create(project_params)
end
def project_params
params.require(:project).permit(
:name,
:tags [
:id,
@nemrow
nemrow / birth-date-picker.hbs
Last active August 29, 2015 14:09
Ember Birth Date Picker Component Template
<!-- templates/components/split-date-selector.hbs -->
<div class="form-group">
<label class=" col-sm-3 control-label">
Birth Date
</label>
<div class="col-sm-5">
<div class="date-field">
{{input 'month' as='select'
collection='monthOptions'
@nemrow
nemrow / birthdate-picker-component.js.coffee
Last active August 29, 2015 14:09
Ember component for datepicker
# components/split-date-selector.js.coffee
Teleborder.SplitDateSelectorComponent = Ember.Component.extend
change: ->
selects = @$().find('select')
month = selects.filter('[name="month"]').val()
day = selects.filter('[name="day"]').val()
year = selects.filter('[name="year"]').val()
currentDate = moment(new Date(year, month, day))
@set('date', new Date(currentDate.toISOString())) if currentDate
function Mammal(options){
this.name = options.name;
this.sex = options.sex;
this.alive = true;
}
function Person(options){
Mammal.call(this, options);
this.children = [];
this.wife;
function livingThing(options){
this.name = options.name;
this.sex = options.sex;
this.alive = true;
}
function Person(options){
livingThing.call(this, options);
this.children = [];
this.wife;