Skip to content

Instantly share code, notes, and snippets.

@rnewman
rnewman / gist:c16b434f00b13908969a
Created April 9, 2015 18:02
Write-triggered sync
04-07 18:10:21.811 I/FxAccounts(25580): fennec_rnewman :: FxAccountSyncAdapter :: Syncing FxAccount account named like [email protected] for authority org.mozilla.fennec_rnewman.db.browser with instance org.mozilla.gecko.fxa.sync.FxAccountSyncAdapter@206b828d.
04-07 18:10:21.816 I/FxAccounts(25580): fennec_rnewman :: FxAccountSyncAdapter :: Account last synced at: 1428455345700
04-07 18:10:21.817 I/FxAccounts(25580): fennec_rnewman :: FirefoxAccounts :: Sync hints; scheduling now: false; ignoring local rate limit: true; ignoring remote server backoff: true.
04-07 18:10:21.823 I/FxAccounts(25580): fennec_rnewman :: FxAccountSyncAdapter :: Not syncing (rate): must wait another 9924ms.
04-07 18:10:21.823 D/GeckoLogger(25580): Thread with tag and thread id releasing lock: null, 441 ...
04-07 18:10:21.823 D/GeckoLogger(25580): Thread with tag and thread id releasing lock: null, 441 ... NOT LOCKED
04-07 18:10:21.841 D/SyncManager( 449): failed sync operation [email protected] u0 (org.mozilla.fenn
@rnewman
rnewman / gist:541a558f143cc64d232f
Last active August 29, 2015 14:18
Swift 1.2 compiler stacktrace
This is the code in question:
---
public func stringArrayForKey(defaultName: String) -> [String]? {
if let arr = self.arrayForKey(defaultName) as? [String]? {
return arr
}
return nil
}
traceroute google.com (04-03 13:12)
traceroute to google.com (216.58.216.206), 64 hops max, 52 byte packets
1 * 192.168.1.1 (192.168.1.1) 1.050 ms 0.850 ms
2 cpe-76-178-144-1.natnow.res.rr.com (76.178.144.1) 30.210 ms 23.194 ms 21.345 ms
3 tge7-1.plmnwaen02h.natnow.rr.com (65.28.215.5) 7.730 ms 10.163 ms 15.980 ms
4 tge1-2.cralidfs01r.natnow.rr.com (72.129.43.26) 11.982 ms 13.065 ms 12.956 ms
5 tge0-4-0-0.sttlwawb02r.natnow.rr.com (72.129.43.108) 20.304 ms 18.294 ms 19.261 ms
6 bu-ether15.sttswa5801w-bcr01.tbone.rr.com (107.14.19.114) 18.799 ms 19.341 ms 23.936 ms
7 0.ae1.pr0.sea20.tbone.rr.com (66.109.6.149) 18.851 ms 17.718 ms 21.183 ms
8 * * *
@rnewman
rnewman / gist:5d5e6a30558743d0cde7
Created March 25, 2015 16:26
Non-localized strings
Account/FxAClient10.swift:68: let errorString = error.error ?? "Missing error"
Account/FxAClient10.swift:69: let messageString = error.message ?? "Missing message"
Client/Application/AppDelegate.swift:108: let alert = UIAlertView(title: "New version available", message: "There is a new version available of Firefox Aurora. Tap OK to go to the download page.", delegate: self, cancelButtonTitle: "Not Now", otherButtonTitles: "OK")
Client/Application/AppDelegate.swift:159: mailComposer.setSubject("Feedback on iOS client version v\(appVersion) (\(buildNumber))")
Client/Frontend/Browser/BrowserViewController.swift:948: var openNewTabAction = UIAlertAction(title: "Open In New Tab", style: UIAlertActionStyle.Default) { (action: UIAlertAction!) in
Client/Frontend/Browser/BrowserViewController.swift:954: var copyAction = UIAlertAction(title: "Copy", style: UIAlertActionStyle.Default) { (action: UIAlertAction!) -> Void in
Client/Frontend/
/**
* Map a function over the values of a map, returning only entries
* for which the function returns non-nil. Works seamlessly with a
* function that has a non-optional type signature, too.
*/
public func mapValues<K, T, U>(source: [K: T], f: (T -> U?)) -> [K: U] {
var m = [K: U]()
for (k, v) in source {
if let u = f(v) {
m[k] = u
@rnewman
rnewman / gist:2f6e99c15edafa9bee7b
Created January 12, 2015 18:26
Error when running Robocop from Eclipse
01-12 10:26:02.447 I/TestRunner( 4085): started: testClearPrivateData(org.mozilla.gecko.tests.testClearPrivateData)
01-12 10:26:02.453 W/Robocop ( 4085): Did not find deviceroot in arguments; falling back to: /mnt/sdcard/tests
01-12 10:26:02.465 I/TestRunner( 4085): failed: testClearPrivateData(org.mozilla.gecko.tests.testClearPrivateData)
01-12 10:26:02.465 I/TestRunner( 4085): ----- begin exception -----
01-12 10:26:02.466 I/TestRunner( 4085):
01-12 10:26:02.466 I/TestRunner( 4085): java.lang.RuntimeException: No log file specified!
01-12 10:26:02.466 I/TestRunner( 4085): at org.mozilla.gecko.FennecNativeDriver.log(FennecNativeDriver.java:354)
01-12 10:26:02.466 I/TestRunner( 4085): at org.mozilla.gecko.FennecNativeDriver.log(FennecNativeDriver.java:349)
01-12 10:26:02.466 I/TestRunner( 4085): at org.mozilla.gecko.FennecNativeDriver.getFile(FennecNativeDriver.java:287)
01-12 10:26:02.466 I/TestRunner( 4085): at org.mozilla.gecko.tests.BaseRobocopTest.setUp(BaseRobocopTest.java:109)
@rnewman
rnewman / gist:57bc73e6f6afd4e624e3
Created December 19, 2014 19:38
Bizarre log output
class TestAccountManager : AccountProfileManager {
override func login(username: String, password: String, error: ((error: RequestError) -> ())) {
let credential = NSURLCredential(user: username, password: password, persistence: .None)
let account = MockAccountProfile()
self.loginCallback(account: account)
return
...
let am = TestAccountManager(loginCallback: { (profile: Profile) -> Void in
@rnewman
rnewman / inherited.playground
Created December 19, 2014 19:30
Inherited protocol methods issue
import Foundation
protocol Profile {
func localName() -> String
}
protocol AccountProfile: Profile {
var accountName: String { get }
}
spec resource 0x7f020000 org.mozilla.fennec_rnewman:drawable/ab_add_search_engine: flags=0x00000000
spec resource 0x7f020001 org.mozilla.fennec_rnewman:drawable/ab_copy: flags=0x00000000
spec resource 0x7f020002 org.mozilla.fennec_rnewman:drawable/ab_cut: flags=0x00000000
spec resource 0x7f020003 org.mozilla.fennec_rnewman:drawable/ab_done: flags=0x00000000
spec resource 0x7f020004 org.mozilla.fennec_rnewman:drawable/ab_paste: flags=0x00000000
spec resource 0x7f020005 org.mozilla.fennec_rnewman:drawable/ab_search: flags=0x00000000
spec resource 0x7f020006 org.mozilla.fennec_rnewman:drawable/ab_select_all: flags=0x00000000
spec resource 0x7f020007 org.mozilla.fennec_rnewman:drawable/ab_stacked_transparent_light_holo: flags=0x00000000
spec resource 0x7f020008 org.mozilla.fennec_rnewman:drawable/action_bar_button: flags=0x00000000
spec resource 0x7f020009 org.mozilla.fennec_rnewman:drawable/action_bar_button_inverse: flags=0x00000000
17:17:45 < jasonmchristos> Youns need to just pack up and head off.
17:17:57 < ckitching> jasonmchristos: Are those like nouns?
17:17:57 < jasonmchristos> I am the internet.
17:18:01 < Guest1> ckitching: as I understand, it's because they got rid of the font inflation checkbox
17:18:14 < jasonmchristos> And theres nothing but a bunch of idiots coded to complain about what I do.
17:18:21 < rnewman> dbaron: would you be so kind? ^
17:18:37 < jasonmchristos> debate party fools
17:18:43 < ckitching> Guest1, What even was font inflation?
17:18:50 < jasonmchristos> everythings a debate
17:18:52 < ckitching> I managed to miss that party, too.