Skip to content

Instantly share code, notes, and snippets.

View andreicristianpetcu's full-sized avatar

Andrei Petcu andreicristianpetcu

  • Bucharest, Romania
View GitHub Profile
@Lusito
Lusito / mozilla-workshop-mozfest-2019.md
Last active November 17, 2019 21:49
Mozilla workshop about Manifest V3 and the Recommended Extensions Program.

Mozilla Workshop Summary.

Some time ago, I've been invited by Mozilla to attend a workshop on the topic of Manifest V3 and the future of the Recommended Extensions Program. Mozilla was paying for the whole trip: Cost of travel, accommodations, food, and even tickets for Mozfest 2019, which was held the two days after. So it was an obvious choice to accept this invitation.

I took the opportunity to collect some thoughts on these topics from different communities:

On October 25th 2019 the workshop took place at Mozillas London office on the day before MozFest and I just

@majido
majido / jank-bookmarklet.js
Last active June 30, 2024 11:42
A bookmarklet to add custom amount of jank to main thread. Crafted for those who 💜 jank!
javascript:(function(){
var meter = `
<label style="position:fixed; z-index:10000; top: 0; left: 50%; transform: translateX(-50%); background-color: pink; padding: 5px;">
Main thread jank (0-500ms): <input id="jankmeter" type="range" min=0 max=500 value=50>
</label>
`;
const d = document.createElement('jank');
d.innerHTML = meter;
document.body.appendChild(d);
@simonw
simonw / recover_source_code.md
Last active September 28, 2024 08:10
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active October 1, 2024 17:10
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@carols10cents
carols10cents / ruby-to-rust-cheat-sheet.md
Last active November 24, 2020 23:12
Ruby to Rust Cheat Sheet

Ruby to Rust Cheat Sheet

The goal of this is to have an easily-scannable reference for the most common syntax idioms in Ruby and Rust so that programmers most comfortable with Ruby can quickly get through the syntax differences and feel like they could read and write basic Rust programs.

What do you think? Does this meet its goal? If not, why not?

Variables

Ruby:

@yunga
yunga / Cliref.md
Last active September 12, 2024 14:10
CLIRef.md
_________ _____ _______________       _____
\_   ___ \\    \\___________   \____ / ____\     ~/.bash/cliref.md
/    \  \/|    | |   ||       _/ __ \  __\    copy/paste from whatisdb
\     \___|__  |_|_  ||    |   \  __/|_ |   http://pastebin.com/yGmGiDQX
 \________  /_____ \_||____|_  /____  /_|     [email protected]
 20160515 \/ 1527 \/         \/     \/

alias CLIRef.txt='curl -s "http://pastebin.com/raw/yGmGiDQX" | less -i'

@Noitidart
Noitidart / _ff-addon-snippet-ManipulateAddonAutoUpdate.js
Created August 19, 2014 07:53
_ff-addon-snippet-ManipulateAddonAutoUpdate - This shows how to manipulate an addon's auto-update setting programatically. Good thing about this is that when you programtically set it while the tab with the add-ons "More" or "Inline Options" pane is visible, the DOM will update there as well.
Cu.import('resource://gre/modules/AddonManager.jsm');
AddonManager.getAddonByID('Profilist@jetpack', function(addon) {
console.info('addon:', addon);
console.info('addon.applyBackgroundUpdates:', addon.applyBackgroundUpdates);
addon.applyBackgroundUpdates = 0; //off
//addon.applyBackgroundUpdates = 1; //default
//addon.applyBackgroundUpdates = 2; //on
});
@brenopolanski
brenopolanski / install-firefox-nightly.md
Created July 30, 2014 00:34
Install Firefox Nightly in Ubuntu via PPA

via: http://www.webupd8.org/2011/05/install-firefox-nightly-from-ubuntu-ppa.html

Add the Mozilla Daily PPA (available for Ubuntu 11.04, 10.10 and 10.04) and install Firefox Nightly using the commands below:

$ [sudo] add-apt-repository ppa:ubuntu-mozilla-daily/ppa
$ [sudo] apt-get update
$ [sudo] apt-get install firefox-trunk

Since this is a daily builds PPA, it's nowhere near stable so use it at your own risk!

macro $if {
rule {
($x...)
} => {
if (relCar($x...))
}
}
macro $while {
rule {