Traefik routing
Proxy to services based on Accept
header.
Run
docker-compose up -d
Proxy to services based on Accept
header.
docker-compose up -d
var gulp = require('gulp'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var browserify = require('browserify'); | |
var watchify = require('watchify'); | |
var babel = require('babelify'); | |
function compile(watch) { | |
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |
export default 'bar'; |
# Floyd-Warshall Algorithm | |
## Introduction: | |
Finds Shortest Path (or longest path) among all pairs of nodes in a graph. | |
Complexity: O(|n|³) | |
## How does it work? | |
- There can be more than one route between two nodes. | |
- The number of nodes in the route isn’t important (Path 4 has 4 nodes but is shorter than Path 2, which has 3 nodes) | |
- There can be more than one path of minimal length |
merchant_id = 'XXXXXXXXXXXXXXXXXXX' | |
merchant_hash_key = 'XXXXXXXXXXXXXXXXXXX' | |
# implemetation for generating form | |
payment_service_for @order.id, merchant_id, \ | |
merchant_hash_key: merchant_hash_key, | |
service: :veritrans, | |
amount: @order.total_amount, | |
currency: 'IDR', | |
html: {:id => 'payment-form' , :authenticity_token => false } do |service| |
require 'mechanize' | |
require 'nokogiri' | |
require 'active_support/all' | |
class SaadAlGhamidi | |
def initialize | |
@page_agent = Mechanize.new | |
@file_agent = Mechanize.new | |
@file_agent.pluggable_parser.default = Mechanize::Download | |
end |
# no config | |
Time.now is localtime | |
1.second.from_now is UTC | |
Timestamp stored in UTC | |
AR not translated | |
Time.now: Fri Aug 24 10:22:25 +0930 2012 | |
1.second.from_now 2012-08-24 00:52:26 UTC |
/** | |
* Get RSpec-style let() in your Mocha/Jasmine specs. | |
*/ | |
var let = function (callback) { | |
var value, called = false; | |
var memoizer = function() { | |
if (called) { | |
return value; | |
} else { | |
called = true; |
# http://ariejan.net/2011/09/24/rspec-speed-up-by-tweaking-ruby-garbage-collection | |
# | |
# Usage: | |
# DEFER_GC=10 rspec spec/ | |
# DEFER_GC=10 cucumber features/ | |
# | |
# put it to spec/support/deferred_garbage_collection_all_in_one.rb | |
# or feature/support/hooks.rb | |
class DeferredGarbageCollection | |
DEFERRED_GC_THRESHOLD = (ENV['DEFER_GC'] || -1).to_f |
~/Code/playground/rails-3-2-stable $ cat app/models/person.rb | |
class Person | |
attr_accessor :abc | |
end | |
~/Code/playground/rails-3-2-stable $ cat app/models/story.rb | |
class Story < ActiveRecord::Base | |
attr_accessor :abc | |
end |