Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
class SessionsController < ApplicationController | |
skip_before_filter :verify_authenticity_token, only: :saml | |
def new | |
request = Onelogin::Saml::Authrequest.new | |
settings = saml_settings | |
request_doc = request.create_authentication_xml_doc(settings) | |
request_str = request_doc.to_s #.force_encoding("UTF-8") | |
logger.debug request_str |
# This is the deployment recipe | |
# You require to install runit on the server. | |
# First you need to declare on which port the application will run | |
# | |
# echo 3000 > port | |
# | |
# Then you can setup a new runit service with | |
# | |
# make setup_service | |
# |
# A simple Makefile alternative to using Grunt for your static asset compilation | |
# | |
## Usage | |
# | |
# $ npm install | |
# | |
# And then you can run various commands: | |
# | |
# $ make # compile files that need compiling | |
# $ make clean all # remove target files and recompile from scratch |
after_fork do |server, worker| | |
# Override the default logger to use a separate log for each Unicorn worker. | |
# https://github.com/rails/rails/blob/3-2-stable/railties/lib/rails/application/bootstrap.rb#L23-L49 | |
Rails.logger = ActiveRecord::Base.logger = ActionController::Base.logger = begin | |
path = Rails.configuration.paths["log"].first | |
f = File.open(path.sub(".log", "-#{worker.nr}.log"), "a") | |
f.binmode | |
f.sync = true | |
logger = ActiveSupport::TaggedLogging.new(ActiveSupport::BufferedLogger.new(f)) |
/** | |
* WkHtmlToPdf table splitting hack. | |
* | |
* Script to automatically split multiple-pages-spanning HTML tables for PDF | |
* generation using webkit. | |
* | |
* To use, you must adjust pdfPage object's contents to reflect your PDF's | |
* page format. | |
* The tables you want to be automatically splitted when the page ends must | |
* have a class name of "splitForPrint" (can be changed). |
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
t = 236 # seconds | |
Time.at(t).utc.strftime("%H:%M:%S") | |
=> "00:03:56" | |
# Reference | |
# http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time |
shared_examples_for "driver with javascript support" do | |
before { @driver.visit('/with_js') } | |
describe '#find' do | |
it "should find dynamically changed nodes" do | |
@driver.find('//p').first.text.should == 'I changed it' | |
end | |
end | |
describe '#drag_to' do |