Skip to content

Instantly share code, notes, and snippets.

# This file contains a definition of the scalar probes that are recorded in Telemetry.
# They are submitted with the "main" pings and can be inspected in about:telemetry.
# The following section contains the accessibility scalars.
a11y:
instantiators:
bug_numbers:
- 1323069
description: >
The leaf name and version number of the binary for the process responsible
@piatra
piatra / tiles_track.js
Created June 16, 2017 11:48
track clicks on tiles
this._linksReporterMod = new PageMod({
attachTo: ["existing", "top"],
contentScript: `links = document.querySelectorAll('.newtab-site')
function log_events(pos) {
return function log(e) {
var target = e.target;
var type;
while (target) {
if (target.tagName === 'a' || target.href) {
type = target.parentNode.getAttribute('type');
@piatra
piatra / test-placesProvider.js
Created June 5, 2017 10:48
places provider test
exports.test_Links_getBookmarks = function*(assert) {
let provider = PlacesProvider.links;
let bookmarks = [
{url: "https://mozilla1.com/0", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK},
{url: "https://mozilla1.com/1", parentGuid: "root________", type: Bookmarks.TYPE_BOOKMARK}
];
for (let placeInfo of bookmarks) {
yield Bookmarks.insert(placeInfo);
@piatra
piatra / main.hs
Created April 26, 2017 06:38
MSF (State StdGen) (Population a) (Population a)
mainPipeline :: MSF (State StdGen) (Maybe (Population a)) (Population a)
mainPipeline = loop ({- implementarea pasilor de EA -}) >>> justStop
-- pmembers scoate lista de indivizi dintr-o structura { pmembers :: [a], pfitness :: [b] }
justStop :: MSF (State StdGen) (Population a) (Population a)
justStop = MSF $ \x -> return $ takeWhile (not . null . pmembers) x
@piatra
piatra / probability.hs
Created December 19, 2015 21:26
Working with probabilities in Haskell
{-# LANGUAGE TypeFamilies,
GeneralizedNewtypeDeriving #-}
-- Example based on http://www.randomhacks.net/2007/02/21/randomly-sampled-distributions/
module NewEx where
import Control.Monad
import Control.Monad.Trans
import Data.List
@piatra
piatra / kfifo_example.c
Created October 28, 2015 19:09
Using kfifo linux api
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/kfifo.h>
MODULE_DESCRIPTION("Kfifo test");
MODULE_AUTHOR("Victor Andrei Oprea");
MODULE_LICENSE("GPL");
class D {
int method(D x) {
return -1;
}
int method() {
return 0;
}
}
class E extends D {
var AppControllerView = React.createClass({
mixins: [
Backbone.Events,
loop.store.StoreMixin("conversationAppStore"),
sharedMixins.WindowCloseMixin
],
propTypes: {
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
mozLoop: React.PropTypes.object.isRequired,
@piatra
piatra / main.java
Created May 24, 2015 17:30
lab practic 2
/*
VICTOR ANDREI OPREA 341 C1
*/
package practicaltest02.pdsd.systems.cs.pub.ro.practicaltest02;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
@piatra
piatra / Dockerfile
Created May 2, 2015 10:55
licenta dockerfile
FROM lukasz/docker-scala
MAINTAINER Andrei Oprea <andrei.br92@gmail.com>
# SSH keys nonsense
RUN echo "IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config
RUN mkdir /root/.ssh
RUN ssh-keyscan -t rsa github.com 2>&1 >> /root/.ssh/known_hosts
# Fetch streamer
RUN git clone https://github.com/piatra/streamer