- Make namespace dynamic
This would handle parts of the url that are based on the session (ie
/users/:user_id
). - Creating/Updating records can pass a record to
buildURL
(see https://github.com/rjackson/ember-data-nested-urls)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Navision | |
class ItemGateway | |
def initialize(options = {}) | |
@client = options.fetch(:client) { Navision.item_client } # item_client => Savon.client(...) | |
end | |
def get_product_by_number(number) | |
get_result client.call :read, message: { 'No' => number } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SMRT_ERRORS = [ServiceClaimsIsATeapot] | |
def ignore_stupid_errors(error_block = ->(*){}) | |
yield | |
rescue *SMRT_ERRORS => e | |
error_block.call e | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class APIClient | |
def get_teapots | |
ignore_errors do | |
make_request :teapots | |
end | |
end | |
def get_coffeepots | |
ignore_errors do | |
make_request :coffeepots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyCustomDatePresenter < HTMLCalendar::DatePresenter | |
# Available methods: `date` and `template` | |
# The only required method | |
def html_classes | |
if monday? | |
['a-case-of-the-mundays'] | |
else | |
[] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def link_to_post(post) | |
html_class = ["post"] | |
html_class << "active" if post.active? | |
link_to(post.title, post, class: html_class) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyFoo | |
def awesome? | |
true | |
end | |
end | |
describe MyFoo do | |
let(:my_foo) { MyFoo.new } | |
it 'is awesome' do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -z "$ghprbSourceBranch" ];then | |
# special case non GHPRB build | |
git fetch origin '+refs/heads/*:refs/remotes/origin/*' | |
git reset --hard "$sha1" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -rubygems | |
# :P | |
# exit | |
require 'digiusb/digiblink' | |
# TODO: | |
COLORS = { | |
'success' => 'green', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.create({ braces: { make: { it: { slightly: { worse: { each: { time: {} } } } } } } }); | |
return { cursor: "is basically one character off here" }; |
OlderNewer