Skip to content

Instantly share code, notes, and snippets.

View owensims1's full-sized avatar

Owen Sims owensims1

View GitHub Profile
pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em
}
code.hljs {
padding: 3px 5px
}
@owensims1
owensims1 / benchmark.rb
Created February 8, 2017 21:31 — forked from panthomakos/benchmark.rb
Benchmark Your Bundle
#!/usr/bin/env ruby
require 'benchmark'
REGEXPS = [
/^no such file to load -- (.+)$/i,
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
/^Missing API definition file in (.+)$/i,
/^cannot load such file -- (.+)$/i,
]
Each new Recipe created can be linked to a restaurant through the restaurant field. The restaurant field currently stores the restaurant name as a string. The name is entered as free text into a text box by the nutrition team on the recipes#new page.
Really we should give a dropdown list of restaurants to select. The available restaurants can be pulled from the backend using the nutrition_app_api e.g.
curl devapi.zesty.com/nutrition_app_api/restaurants -H 'X-HASTY-API-KEY: nutrition-app-exercise'
{"restaurants":[{"id":"50a123f8d8c6229f09000001","name":"Darn Good Food"},{"id":"5144fcf8eefbfe8e83000001","name":"Beautifull"},{"id":"5153034beefbfea8b4000001","name":"Wonderland"},{"id":"51788281eefbfef816000001","name":"Thai Noodle Bar \u0026 Grill"},{"id":"518d34c3eefbfe9b3e000001","name":"Jasmine Tea House"},{"id":"519126d3eefbfea989000001","name":"Mehfil Indian Cuisine \u0026 Bar"},{"id":"5191e64deefbfed8e9000001","name":"Bamboo Asia"},{"id":"51ad43c7eefbfe6ae5000001","name":"Baby Blues BBQ"},{"id":"51ae5717
@owensims1
owensims1 / gist:a4f2eb48a7b81ad1b672
Last active March 22, 2016 19:34
Interactor Pattern is the worst.
http://bparanj.blogspot.com/2014/06/why-using-interactor-gem-is-very-bad.html
https://news.ycombinator.com/item?id=7335211