Skip to content

Instantly share code, notes, and snippets.

View pedrocunha's full-sized avatar
🦖

Pedro Cunha pedrocunha

🦖
  • Deliveroo
  • Lisbon
View GitHub Profile
// original source: https://medium.com/@ndyhrdy/making-the-bottom-sheet-modal-using-react-native-e226a30bed13 🙇
import React, {useEffect, useRef} from 'react';
import {
Animated,
Dimensions,
Modal,
PanResponder,
StyleSheet,
View,
} from 'react-native';
@pedrocunha
pedrocunha / example.md
Last active July 30, 2018 16:06
Toggling between machine learning models with a single attribute

Deliveroo Engineering

At Logistics Algorithms we use a lot of machine learning models to compute/predict time estimates for parts of the order journey, either before, while or after orders are placed. Everything we rollout is previously experimented via a traditional but slightly elaborated AB/testing (a blog post to some other time).

Sometimes we want to test a new model for a particular geographical region, other times we want a way to toggle between models while time goes by (ab testing), or we simply we want to quickly disable everywhere a particular model. While we use and advocate the use of global feature flags, we also need these more refined capabilities.

You can accomplish this pattern by using the datastore of your choice in which you store a setting attribute (for example in our case we might put this as a "Zone" attribute so we can test zones separately) that dictates which model should be used. The default setting should always be the "NoOp" scenario that just returns a "no-op" value.

@pedrocunha
pedrocunha / example.py
Created December 5, 2011 21:25
Invoicexpress API - Python Example
import httplib, urllib
account_name = 'XXXX'
api_key = 'XXXXX'
url = account_name + '.invoicexpress.net:443'
endpoint = '/invoices.xml?api_key=' + api_key
headers = {
'Content-type' : 'application/xml; charset=utf-8',
'Accept' : 'text/plain'
@pedrocunha
pedrocunha / core_extensions.rb
Created September 30, 2011 15:39
Patch postmark gem to resend emails with exceptions to a error mailing list
module PostmarkNoExceptions
def self.included(base)
base.extend ClassMethods
base.class_eval do
class << self
alias_method_chain :send_through_postmark, :no_exceptions
end
end
end