Skip to content

Instantly share code, notes, and snippets.

View pocmo's full-sized avatar
🚀
Just passing by.

Sebastian Kaspari pocmo

🚀
Just passing by.
View GitHub Profile
@pocmo
pocmo / gist:a47e93254ecac0d26695
Created July 16, 2015 12:57
Android M-Preview 2 - Permissions + Groups + Protection Level
(android.permission-group.CONTACTS) android.permission.READ_CONTACTS dangerous
(android.permission-group.CONTACTS) android.permission.WRITE_CONTACTS dangerous
(android.permission-group.CONTACTS) android.permission.READ_PROFILE dangerous
(android.permission-group.CONTACTS) android.permission.WRITE_PROFILE dangerous
(android.permission-group.CALENDAR) android.permission.READ_CALENDAR dangerous
(android.permission-group.CALENDAR) android.permission.WRITE_CALENDAR dangerous
(android.permission-group.SMS) android.permission.SEND_SMS dangerous
(android.permission-group.SMS) android.permission.RECEIVE_SMS dangerous
(android
@pocmo
pocmo / PermissionsExample.java
Last active April 14, 2016 12:33
Firefox for Android - Permissions Example
Permissions
.from(context)
.withPermissions(Manifest.permission.ACCESS_FINE_LOCATION)
.onUIThread()
.andFallback(() -> doSomethingIfPermissionsHasNotBeenGranted())
.run(() -> doSomethingWithPermission());
// Granting a single permission to an app
adb shell pm grant <package> android.permission.<permission>
// Install the APK with all runtime permissions granted automatically:
adb install -g <apk>
##############################################################
# Build Firefox for Android ##################################
##############################################################
ac_add_options --enable-application=mobile/android
mk_add_options MOZ_OBJDIR=./objdir-frontend
# Artifact builds (Fox yeah!)
ac_add_options --enable-artifact-builds
@pocmo
pocmo / count.js
Last active April 25, 2017 09:54
Count open/closed/total tasks for list of visible GitHub issues
(function() {
let open = total = done = 0;
let collection = document.getElementsByClassName('task-progress-counts');
for (let i = 0; i < collection.length; i++) {
let counts = collection[i].innerHTML.split(" of ").map((x) => parseInt(x));
total += counts[1]; done += counts[0]; open += counts[1] - counts[0];
}
alert("Total: " + total + "\nOpen: " + open + "\nDone: " + done);
})();

Questions

  • Can a language pack be a single file?

Catalog example entry

{
  last_modified:	1476698557996
  schema:	        1476697392908
  id:           	"9cc46c00-ac25-4e6f-8280-6711cad2efe6"
 type: "asset-archive"
##############################################################
# Build Firefox for Android ##################################
##############################################################
ac_add_options --enable-application=mobile/android
mk_add_options MOZ_OBJDIR=./objdir-frontend
# Artifact builds (Fox yeah!)
ac_add_options --enable-artifact-builds
# See all local images
docker images
# Start bash in image
docker run -it <image> /bin/bash
# Show all containers
docker ps -a
# Join container
# Linux:
adb shell screencap -p | sed 's/\r$//' > screen.png
# OS X:
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png
@pocmo
pocmo / api-scribble.kt
Last active October 26, 2017 16:14
Experiments - Kotlin - Scribble
// In this scribble the experiments (A/B) library is called "Fretboard"
// Experiments.* are not part of the library but constants in the actual app project
///////////////////////////////////////////////////////////////////////////
// Simple API (Java style):
///////////////////////////////////////////////////////////////////////////
if (Fretboard.isInEperiment(Experiments.BOOKMARKS)) {
// do something