Skip to content

Instantly share code, notes, and snippets.

View fluffyemily's full-sized avatar

Emily Toop fluffyemily

View GitHub Profile
@fluffyemily
fluffyemily / build_error
Created June 7, 2019 16:34
Build error when building version of mozilla-central fetched 7th June 2019
./mach build
0:00.72 Clobber not needed.
0:00.72 Adding make options from /Users/emilytoop/Development/FirefoxDeskop/gecko/mozconfig
MOZ_OBJDIR=/Users/emilytoop/Development/FirefoxDeskop/gecko/obj-i686-unknown-linux-android
OBJDIR=/Users/emilytoop/Development/FirefoxDeskop/gecko/obj-i686-unknown-linux-android
FOUND_MOZCONFIG=/Users/emilytoop/Development/FirefoxDeskop/gecko/mozconfig
export FOUND_MOZCONFIG
0:00.74 /usr/bin/make -f client.mk -s
0:01.06 Elapsed: 0.00s; From dist/public: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
0:01.06 Elapsed: 0.00s; From dist/private: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
@fluffyemily
fluffyemily / gist:f399e589d6081aa3021c1aa5cfe4a2d6
Last active January 31, 2019 14:34
Code to get a snapshot from a surface in Gecko.
void RecvScreenPixels(Shmem&& aMem, const ScreenIntSize& aSize) {
MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
const IntSize size(aSize.width, aSize.height);
RefPtr<DataSourceSurface> image = gfx::CreateDataSourceSurfaceFromData(
size,
SurfaceFormat::B8G8R8A8,
aMem.get<uint8_t>(),
StrideForFormatAndWidth(SurfaceFormat::B8G8R8A8, aSize.width));
@fluffyemily
fluffyemily / geofirequeries.swift
Created October 17, 2016 16:39
Querying Geofire with Swift
let geofireRef = FIRDatabase.database().reference()
guard let geofire = GeoFire(firebaseRef: geofireRef.child("venues/")) else { return }
geofire.getLocationForKey(placeKey) { (location, error) in
if let error = error {
print("An error occurred getting the location for \(placeKey): \(error.localizedDescription)")
} else if let location = location {
print("Location for \(placeKey) is [\(location.coordinate.latitude), \(location.coordinate.longitude)]")
} else {
print("GeoFire does not contain a location for \(placeKey)")
@fluffyemily
fluffyemily / gist:95b0dc6ff64063f890df
Created December 15, 2015 15:42
animate URLBar in TabTrayViewController when dismissing to BVC
self.navigationController?.popViewControllerAnimated(true)
browserViewController?.urlBar.updateAlphaForSubviews(1)
[browserViewController?.header,
browserViewController?.footer,
browserViewController?.readerModeBar,
browserViewController?.footerBackdrop,
browserViewController?.headerBackdrop].forEach { view in
view?.transform = CGAffineTransformIdentity
}
FAILURE: Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLKey=https://api.accounts.firefox.com/v1/account/login?keys=true, NSLocalizedDescription=cancelled, NSErrorFailingURLStringKey=https://api.accounts.firefox.com/v1/account/login?keys=true}
func application(application: UIApplication, performFetchWithCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
let delegate = BrowserProfileSyncDelegate(app: UIApplication.sharedApplication())
delegate.displaySentTabForURL(NSURL(string: "http://mozilla.com")!, title: "Mozilla")
completionHandler(.NewData)
}