In this case, the API endpoint is dev-api.dtime.com.
http get https://dev-api.dtime.com
See a JS fiddle example:
| #!/bin/bash | |
| git_is_dirty(){ | |
| if [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]]; then | |
| echo "1" | |
| else | |
| echo "0" | |
| fi | |
| } | |
| DIR=`pwd` |
| # this script's occupy method didn't work very well. HTTParty isn't good at PUTs. | |
| # | |
| # Try rest-client gem instead: | |
| # | |
| # | |
| # $ gem install rest-client | |
| # $ restclient 'http://apiwars.heroku.com' | |
| # > get '/grid/123', {:params => {:api => '...', :pin => '2222'}} | |
| # ---> {...} | |
| # > put '/grid/123', {:api => '...', :pin => '...', :unit => 'testunit'} |
| #!/bin/bash | |
| cd /tmp | |
| # Set up site 1. | |
| nanoc create_site foo | |
| cd foo | |
| git init | |
| git add . | |
| git commit -m "Init" |
| class Comparison | |
| include DataMapper::Resource | |
| property :id, Serial | |
| has n, :msruns, :through => Resource | |
| has n, :secondary_msruns, "Msrun", :through => SecondaryMsrunComparison, :via => :msrun | |
| belongs_to :metric | |
| end | |
| class Msrun |
| // ==UserScript== | |
| // @name Awesome | |
| // @namespace http://fluidapp.com | |
| // @description What does this do? | |
| // @include * | |
| // @author Someone | |
| // ==/UserScript== | |
| (function () { |
| # | |
| # $ rails new [app_name] -m https://raw.github.com/gist/1454641/wizard.txt -T -O | |
| # | |
| # >---------------------------------------------------------------------------< | |
| # | |
| # _____ _ _ __ ___ _ | |
| # | __ \ (_) | \ \ / (_) | | | |
| # | |__) |__ _ _| |___\ \ /\ / / _ ______ _ _ __ __| | | |
| # | _ // _` | | / __|\ \/ \/ / | |_ / _` | '__/ _` | | |
| # | | \ \ (_| | | \__ \ \ /\ / | |/ / (_| | | | (_| | |
| # lib/tasks/assets.rake | |
| # | |
| # adapted from: http://blog.noizeramp.com/2011/10/14/rails-3-asset-pipeline-on-heroku-when-using-mongoid/ | |
| # | |
| pt = Rake::Task['assets:environment'] | |
| Rake.application.send(:eval, "@tasks.delete('assets:environment')") | |
| namespace :assets do | |
| task :environment do | |
| module ::MongoMapper::Connection |
| I've been playing with the idea of combining the data array defined in application/collection+json | |
| (http://amundsen.com/media-types/collection/format/) with hal links for templated data. | |
| Seems like a good way to keep the media type lightweight while allowing the api to specify the fields | |
| it would like passed to a given resource. | |
| I haven't really given much thought to an xml variation, but I took a stab at it as well. |
In this case, the API endpoint is dev-api.dtime.com.
http get https://dev-api.dtime.com
See a JS fiddle example:
| class ApplicationController | |
| # Sharing the setup of processors, since many actions will use them | |
| # - thinking of switching this out for a facade | |
| def trigger_processor(name, listening_controller) | |
| processor_klass = processors[name] | |
| processor = processor_klass.new(params) | |
| processor.add_listener(EventNotifier.new) | |
| processor.add_listener(listening_controller) | |
| processor.process(current_user) | |
| end |