Skip to content

Instantly share code, notes, and snippets.

Eli Perelman eliperelman

Block or report user

Report or block eliperelman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@eliperelman
eliperelman / gist:9539770
Created Mar 14, 2014
OS X: Bash function to change the desktop wallpaper across all monitors and spaces. Tested on Mavericks.
View gist:9539770
# Usage:
# wallpaper path/to/image.png
function wallpaper() {
image=`echo $(cd $(dirname $1); pwd)/$(basename $1)`
cd /System/Library/CoreServices
sudo rm -f DefaultDesktop.jpg
sudo ln -sf $image DefaultDesktop.jpg
View logcat.txt
I/Gonk ( 1902): Setting nice for pid 1990 to 1
I/Gonk ( 1902): Changed nice for pid 1990 from 18 to 1.
I/GeckoDump( 1902): XXX FIXME : Got a mozContentEvent: activity-choice
I/Gonk ( 1902): Setting nice for pid 2479 to 18
I/Gonk ( 1902): Changed nice for pid 2479 from 18 to 18.
I/Gecko ( 1902): [Parent 1902] WARNING: waitpid failed pid:2479 errno:10: file /home/eli/B2G/gecko/ipc/chromium/src/base/process_util_posix.cc, line 254
I/Gonk ( 1902): Setting nice for pid 2479 to 1
I/Gonk ( 1902): Changed nice for pid 2479 from 18 to 1.
E/[Gralloc-ERROR]( 1902): int gralloc_register_buffer(const gralloc_module_t*, const native_handle_t*):79 Unable to register handle 0x48486290 coming from different process: 1902
E/[Gralloc-ERROR]( 1902): int gralloc_register_buffer(const gralloc_module_t*, const native_handle_t*):79 Unable to register handle 0x48486330 coming from different process: 1902
View thoughts.md

Problem

The current process of timing the launching of Firefox OS applications is tricky. At the time of writing, most tests rely on the firing of the window onload event in order to determine when it is ready to use. Unfortunately with the state of dynamic script and view loading, it's impossible to tell when an application is truly ready to be interacted with. The loading of these assets can be deferred, sometimes even to the point where it occurs after window onload. If we want to hold an application accountable to recommended launch times, engineers need only defer more loading until the test measurement completes in order to make metrics look attractive. Couple this with the fact that the event isn't truly indicative of user interactivity and you can see that the current state is unsustainable.

Interim Solution

I suggested that if we were to get an accurate pulse on when launch times occur, it was going to take being told by the application itself. There are techniques we can use to try

View error.txt
eli@precision:~/B2G$ b2gperf --delay=10 --iterations=30 Messages
2014-08-06 16:21:53,792 B2GPerfRunner WARNING | Missing required DataZilla field: oauth_secret
2014-08-06 16:21:53,792 B2GPerfRunner WARNING | Missing required DataZilla field: oauth_key
2014-08-06 16:21:53,792 B2GPerfRunner WARNING | Missing required DataZilla field: build_revision
2014-08-06 16:21:53,792 B2GPerfRunner WARNING | Missing required DataZilla field: device_name
2014-08-06 16:21:53,792 B2GPerfRunner WARNING | Missing required DataZilla field: project
2014-08-06 16:21:53,792 B2GPerfRunner WARNING | Missing required DataZilla field: gecko_revision
2014-08-06 16:21:53,792 B2GPerfRunner WARNING | Missing required DataZilla field: branch
2014-08-06 16:21:53,792 B2GPerfRunner INFO | Reports will not be submitted to DataZilla
@eliperelman
eliperelman / nspr.sh
Created Oct 28, 2014
Enable/disable NSPR Logging
View nspr.sh
#!/bin/sh
# Alias this script for easier experience
# Usage:
# ./nspr.sh on
# ./nspr.sh off
NSPR="export NSPR_LOG_MODULES=ObserverService:5"
OPTION=$1
DISK_DEVICE=`adb shell mount | grep '/system' | awk '{ print $1 }'`
View keybase.md

Keybase proof

I hereby claim:

  • I am eliperelman on github.
  • I am eliperelman (https://keybase.io/eliperelman) on keybase.
  • I have a public key whose fingerprint is 8681 E477 A9A0 335D B3A7 3D95 4546 8CD4 8475 2906

To claim this, I am signing this object:

@eliperelman
eliperelman / LICENSE.txt
Created Jun 20, 2011 — forked from 140bytes/LICENSE.txt
String trim methods polyfill for 140byt.es
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Eli Perelman <http://eliperelman.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@eliperelman
eliperelman / LICENSE.txt
Created Jun 21, 2011 — forked from 140bytes/LICENSE.txt
Array.prototype.every polyfill for 140byt.es
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Eli Perelman <http://eliperelman.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@eliperelman
eliperelman / LICENSE.txt
Created Jun 21, 2011 — forked from 140bytes/LICENSE.txt
Array.prototype.some polyfill for 140byt.es
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Eli Perelman <http://eliperelman.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
View example.js
// Antipattern:
var x = 10;
var y = function () {
console.log(x); // logs undefined
var x = 20;
return x + 10;
};
You can’t perform that action at this time.