Skip to content

Instantly share code, notes, and snippets.

View sleroux's full-sized avatar
:shipit:
on the loose

Stephan Leroux sleroux

:shipit:
on the loose
  • Shopify
  • Toronto, ON, Canada
View GitHub Profile
[09:14:17]: Exit status of command '../scripts/localise.sh --only-complete' was 1 instead of 0.
Activating virtualenv
New python executable in python-env/bin/python2.7
Also creating executable in python-env/bin/python
Installing setuptools, pip, wheel...done.
You are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting lxml
Installing collected packages: lxml
Successfully installed lxml-3.5.0
{
"event_id": "64bc8a496ad8c77b63ad0ca30e1fbe33",
"message": "RuntimeError: \u001b[31mCould not find action or lane 'params'. Check out the README for more details: https://github.com/fastlane/fastlane\u001b[0m",
"timestamp": "2016-01-18T16:18:12",
"time_spent": null,
"level": 40,
"project": null,
"platform": "ruby",
"logger": "",
"culprit": "fastlane/runner.rb in try_switch_to_lane at line 117",
@sleroux
sleroux / gist:5143923
Created March 12, 2013 15:36
iOS web debugginator
#!/bin/bash
# Open iPhone Simulator on default location for XCode 4.3 if found
[[ -d /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/ ]] &&
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app
# Open iPhone Simulator on default location for XCode 4.2 if found
[[ -d /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/ ]] &&
open /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app
@sleroux
sleroux / gist:4568466
Created January 18, 2013 20:58
Using Fibers to write linear callback code
require 'eventmachine'
require 'em-http'
require 'fiber'
# Borrowed from http://www.igvita.com/2010/03/22/untangling-evented-code-with-ruby-fibers/
def async_fetch(url)
# Grab a reference to which fiber I am
f = Fiber.current
@sleroux
sleroux / gist:3293e1973ecfba9cddc9
Created November 19, 2015 13:58
Fastlane Error Log 2
[08:28:06]: ------------------------------------
[08:28:06]: --- Step: increment_build_number ---
[08:28:06]: ------------------------------------
[08:28:06]: [SHELL COMMAND]: cd /Users/sleroux/development/firefox-ios && agvtool new-version -all 1
[08:28:07]: [SHELL]: Setting version of project Client to:
[08:28:07]: [SHELL]: 1.
[08:28:07]: [SHELL]:
[08:28:07]: [SHELL]: Also setting CFBundleVersion key (assuming it exists)
[08:28:07]: [SHELL]:
[08:28:07]: [SHELL]: Updating CFBundleVersion in Info.plist(s)...
[10:58:21]: Successfully loaded custom action '/Users/sleroux/development/firefox-ios/fastlane/actions/checkout_git_branch.rb'.
[10:58:21]: Using branch: fluffyemily/fastlane-integration
[10:58:21]: Using build: 1
[10:58:21]: Using version: 1.0.0
[10:58:21]: Using username: <>
[10:58:21]: -------------------------------------------------
[10:58:21]: --- Step: Verifying required fastlane version ---
[10:58:21]: -------------------------------------------------
[10:58:21]: fastlane version valid
[10:58:21]: ------------------------------
@sleroux
sleroux / frecency.md
Last active October 14, 2015 19:57
Frecency/Top Sites Optimization

The frecency query [1] we're making for our search recommendations/top sites is painfully slow. The query can up to a few seconds before completing. This is noticeable in places such as Top Sites where we run this query every time the user visits the panel. The items in Top Sites don’t render until the query completes. When taking a closer look at the query we're running to determine frecency, there are a number of factors which are causing it to be slow. Unlike desktop, frecency on mobile is calculated in real time instead of being pre-calculated. This results in a complex query that touches various tables with inner joins and computationally expensive ORDER/COALESCE operations. The query is then run on a potentially large data set since it touches the history table. In cases where a user has attached their FxA account, their desktop history will also be part of this.

After some discussion, there are 2 approaches we can take to optimize the way we handle frecency:

  1. Tweak/modify the existing query. Th
var data2xml = require("data2xml"),
key = 'splashScreen',
xmlObject = {},
imgPath = "dummyImage.png";
xmlObject[key] = {},
xmlObject[key]['image'] = [];
// Push 2 different images for each localization
xmlObject[key]["image"].push({
Storage!_TFFC7Storage12BrowserTable11updateTableFS0_FTCS_18SQLiteDBConnection4fromSi2toSi_SbU_FCS_5SDRowSS + 0x108
fp = 0x000000016fdfc850 lr = 0x00000001005b11f4
sp = 0x000000016fdfc840 pc = 0x00000001005c4c14
Found by: previous frame's frame pointer
11 Storage!_TTRXFo_oC7Storage5SDRow_oSS_XFo_oS0__iSS_ + 0x1c
fp = 0x000000016fdfcb00 lr = 0x000000010059a828
sp = 0x000000016fdfc860 pc = 0x00000001005b11f4
Found by: previous frame's frame pointer
12 Storage!_TZFC7StorageP33_3F4389F18684E136A114953F0C3F855C18FilledSQLiteCursor9getValuesU__fMGS0_Q__FTCS_P33_3F4389F18684E136A114953F0C3F855C17SQLiteDBStatement7factoryFCS_5SDRowQ_6statusROS_12CursorStatus13statusMessageRSS_GSaQ__ + 0x4e4
fp = 0x000000016fdfcbe0 lr = 0x000000010059a2a4