Skip to content

Instantly share code, notes, and snippets.

View bebef1987's full-sized avatar

Florin Strugariu bebef1987

  • Mozilla
  • Cluj-Napoca, Romania
View GitHub Profile
@bebef1987
bebef1987 / alternate-server-replay.py
Created November 27, 2018 16:16
alternate-server-replay.py
import hashlib
import http
import urllib
import typing
import sys
from collections import defaultdict
from mitmproxy import ctx, http
from mitmproxy import flow
@bebef1987
bebef1987 / main.py
Created October 23, 2018 15:15
bisect
import subprocess
import hglib
def main():
print "ok"
client = hglib.open("C:\\mozilla-source\\autoland")
commits = client.log("8f7bb583fbb5:73c033dd56a2")
commits.reverse()
@bebef1987
bebef1987 / hj
Created October 19, 2016 08:48
Serenity Batches
h
@bebef1987
bebef1987 / jquery.js
Last active August 29, 2015 14:10
Script to Output test/device status mapping
/*! jQuery v1.8.2 jquery.com | jquery.org/license */
(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,funct
@bebef1987
bebef1987 / omni.sh
Last active August 29, 2015 14:05
omni
rm -rf omni
rm -rf omni.ja
adb remount
adb pull /system/b2g/omni.ja
unzip omni.ja -d /home/florinstrugariu/mc/omni
sleep 2
cp -r gecko-dev/testing/marionette/* omni/chrome/marionette/content/
cd omni
zip -r omni.ja *
@bebef1987
bebef1987 / kill_all.py
Created October 27, 2013 10:09
Kill all method
def kill_all(self):
self.marionette.switch_to_frame()
self.marionette.execute_async_script("""
// Kills all running apps, except the homescreen.
function killAll() {
let originsToClose = [];
let that = this;
let runningApps = window.wrappedJSObject.WindowManager.getRunningApps();
for (let origin in runningApps) {
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
'use strict';
var GaiaApps = {
normalizeName: function(name) {
return name.replace(/[- ]+/g, '').toLowerCase();
@bebef1987
bebef1987 / bin
Created July 30, 2013 14:19
test_notification
(gaia)bebe@P5171:~/gaia/gaia-ui-tests$ gaiatest --address localhost:2828 --testvars=/home/bebe/webqa/webqa-credentials/b2g.gaia.json --type=b2g-xfail-unit --restart gaiatest/tests/system/test_system_notification_bar.py --repeat 10
starting httpd
running webserver on http://192.168.77.102:44433/
TEST-START test_system_notification_bar.py
test_notification_bar (test_system_notification_bar.TestNotificationBar) ... ok
----------------------------------------------------------------------
Ran 1 test in 45.408s
OK
class NewContact(ContactForm):
_done_button_locator = ('id', 'save-button')
_new_contact_frame_locator = ('css selector', "iframe[src^='app://communications'][src$='contacts/index.html?new']")
def __init__(self, marionette,switch_to_frame = False):
ContactForm.__init__(self, marionette)
if switch_to_frame:
self.marionette.switch_to_frame()
self.wait_for_element_present(*self._new_contact_frame_locator)
@bebef1987
bebef1987 / logme.txt
Created June 10, 2013 14:36
logcat window_manager.js
I/Gecko:MemoryInfoDumper( 109): FifoWatcher::OpenFifo unlink failed; errno=2. Continuing despite error.
E/GeckoConsole( 109): Could not read chrome manifest 'file:///system/b2g/chrome.manifest'.
I/Gecko ( 109): Warning: No fanotify support in this device's kernel.
I/Gecko ( 109): 1370874636951 Marionette INFO MarionetteComponent loaded
I/Gecko ( 109): 1370874636956 Marionette INFO marionette enabled
I/Gecko ( 109): 1370874639521 Marionette INFO marionette initializing at final-ui-startup
I/Gecko ( 109): 1370874639830 Marionette INFO marionette-actors.js loaded
I/Gecko ( 109): 1370874639831 Marionette INFO B2G emulator: no
I/Gecko ( 109): 1370874639832 Marionette INFO Platform detected is unagi
I/Gecko ( 109): 1370874639837 Marionette INFO marionette listener opened