Skip to content

Instantly share code, notes, and snippets.

Avatar

David Bourguignon dbourguignon

View GitHub Profile
@dbourguignon
dbourguignon / proc_composition-2.rb
Last active Jan 25, 2019
Proc composition in ruby 2.6
View proc_composition-2.rb
require "bigdecimal"
# List of our individual pricing rules
TAX = ->(val) { val + val*0.05 }
FEE = ->(val) { val + 1 }
PREMIUM = ->(val) { val + 10 }
DISCOUNT = ->(val) { val * 0.90 }
ROUND_TO_CENT = ->(val) { val.round(2) }
# One presenter
PRESENT = ->(val) { val.to_f }
View snippet.rb
# require "rack/openid"
require 'devise/strategies/base'
require 'uri'
module Devise
module Strategies
# Default strategy for signing in a user, based on openid
# Redirects to sign_in page if it's not authenticated
class OpenId < Warden::Strategies::Base
include Devise::Strategies::Base
View gist:66790
@implementation MyAppDelegate
static NSOperationQueue *sharedOperationQueue = nil;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
//setup the operation queue
You can’t perform that action at this time.