Skip to content

Instantly share code, notes, and snippets.

View jkmcrg's full-sized avatar

Jake McHargue jkmcrg

View GitHub Profile
I woke up knowing I didn't have heat.
It's something you just know if you have ever lived in a place with propane heating.
You wake up and the air feels still, and you hear the clicking of a pilot light and you know it's been doing that for a while
it was 3am
I layed there and listened to the clicking
app.factory 'Project', [
'$resource'
($resource) ->
Project = ->
@service = $resource('/api/projects/:projectId', {projectId: '@id'})
return
Project::all = ->
@service.query()
app.controller 'ProjectCtrl', [
'$scope'
'Project'
($scope, Project) ->
$scope.project = Project.get(1)
console.log $scope.project.title
#=> undefined
]
# opens up the latest migration from rails root
# typically use right after a generator
function vimm() {
for file in db/migrate/*; do [[ $file -nt $latest ]] && latest=$file; done; vim "$latest"
}
multi_match: {
query: q,
fields: %W(title subtitle short_description body)
},
bool: {
must: { match: { published: false } }
}
@jkmcrg
jkmcrg / gist:9009297
Last active August 29, 2015 13:56
collection select
# this:
%select{name: "recipe[recipe_season_id]"}
-for season in @recipe_seasons
%option{value: season.id, selected: season_option_select(season)}= season.name
# can be replaced with this:
= f.collection_select :season_id, @recipe_seasons, :id, :name
# Where `f` is the form object, `season_id` is the field of the object that you
# want to set,`@season` is the collection, `:id` is the method to call on
run bundle install from "."
Fetching [email protected]:elasticsearch/elasticsearch-ruby.git
remote: Counting objects: 3689, done.
remote: Compressing objects: 100% (1847/1847), done.
remote: Total 3689 (delta 1945), reused 3411 (delta 1744)
Receiving objects: 100% (3689/3689), 657.75 KiB | 539.00 KiB/s, done.
Resolving deltas: 100% (1945/1945), done.
Fetching [email protected]:elasticsearch/elasticsearch-rails.git
remote: Counting objects: 1227, done.
remote: Compressing objects: 100% (457/457), done.