Skip to content

Instantly share code, notes, and snippets.

@implementation MyAppDelegate
static NSOperationQueue *sharedOperationQueue = nil;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
//setup the operation queue
# 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
@dbourguignon
dbourguignon / proc_composition-2.rb
Last active July 9, 2021 01:16
Proc composition in ruby 2.6
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 }

Keybase proof

I hereby claim:

  • I am dbourguignon on github.
  • I am dbourguignon (https://keybase.io/dbourguignon) on keybase.
  • I have a public key ASBZKF7iwmcVFkWS7f-fmfhI14Xfy7mklzF05L1lQKm6_go

To claim this, I am signing this object: