The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
| [Unit] | |
| Description=App Redis Sidekick | |
| Requires=docker.service | |
| Requires=etcd.service | |
| After=docker.service | |
| After=etcd.service | |
| After=app-redis.service | |
| BindsTo=app-redis.service |
| apt-get install xvfb | |
| apt-get install firefox |
| [ | |
| {"group":"US (Common)", | |
| "zones":[ | |
| {"value":"America/Puerto_Rico","name":"Puerto Rico (Atlantic)"}, | |
| {"value":"America/New_York","name":"New York (Eastern)"}, | |
| {"value":"America/Chicago","name":"Chicago (Central)"}, | |
| {"value":"America/Denver","name":"Denver (Mountain)"}, | |
| {"value":"America/Phoenix","name":"Phoenix (MST)"}, | |
| {"value":"America/Los_Angeles","name":"Los Angeles (Pacific)"}, | |
| {"value":"America/Anchorage","name":"Anchorage (Alaska)"}, |
| r := mux.NewRouter() | |
| // Single handler | |
| r.HandleFunc("/form", use(http.HandlerFunc(formHandler), csrf, logging) | |
| // All handlers | |
| http.Handle("/", recovery(r)) | |
| // Sub-routers | |
| apiMiddleware := []func(http.Handler) http.Handler{logging, apiAuth, json} |
| ENV["RAILS_ENV"] ||= 'test' | |
| require File.expand_path("../../config/environment", __FILE__) | |
| require 'rspec/rails' | |
| require 'rspec/autorun' | |
| require 'capybara/rspec' | |
| require 'webmock/rspec' | |
| require 'factory_girl' | |
| require 'factory_girl_rails' | |
| Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} |
| package main | |
| import ( | |
| "fmt" | |
| "runtime" | |
| "sync" | |
| "time" | |
| ) | |
| func main() { |
| /* | |
| * grunt | |
| * https://github.com/cowboy/grunt | |
| * | |
| * Copyright (c) 2012 "Cowboy" Ben Alman | |
| * Copyright (c) 2012 John K. Paul @johnkpaul | |
| * Licensed under the MIT license. | |
| * http://benalman.com/about/license/ | |
| */ |
| # add this file capybara_wait_until.rb to your /test directory | |
| module Capybara | |
| class Session | |
| ## | |
| # | |
| # Retry executing the block until a truthy result is returned or the timeout time is exceeded | |
| # | |
| # @param [Integer] timeout The amount of seconds to retry executing the given block | |
| # |
| def gravatar_url(email,options = {}) | |
| require 'digest/md5' | |
| hash = Digest::MD5.hexdigest(email) | |
| url = "http://www.gravatar.com/avatar/#{hash}" | |
| options.each do |option| | |
| option == options.first ? url+="?" : url+="&" | |
| key = option[0].to_s | |
| value = option[1].to_s | |
| url+=key + "=" + value | |
| end |