This file has been truncated, but you can view the full file.
View gist:203c131f7a24057f593759f43564c04c
View gist:3e0a017b913bd493da665329f3d52cad
View _ff-addon-snippet-AddToolbarButtonToPalette.js
var doc = document;
var win = doc.defaultView;
var toolbox = doc.querySelector('#navigator-toolbox');
var buttonId = 'bpMyBtn';
var button = doc.getElementById(buttonId);
if (!button) {
button = doc.createElementNS('', 'toolbarbutton');
button.setAttribute('id', buttonId);
View _ff-addon-snippet-CreateMenuWithSubmenuAndAttachToWidget.js
function doit() {
//create and add the panel now
var doc = document;
var myWidget = doc.getElementById('widget:jid1-lwNbwJJiiMXM4A@jetpack-open-traveleye'); //we add the menu to this widget, we can add menu to anything by setting the context attribute of it to the id of the menu we want to give it
var myMenuJson =
['xul:menupopup', {id: 'myMenu1'},
['xul:menuitem', {label:'menu item1'}],
['xul:menu', {label:'menu item2 is submenu1'},
['xul:menupopup', {},
View _js-snippet-MDNBuildingDomTrees.js
function example() {
var hotkeyLabelJson =
['ul', {class: 'apple cf',id:'apple-qwerty'},
['li', {class:'apple'},
['a',{class:'nthotkey-apple-key apple-key'},
[span, {},
View _php-array-merge-ref-preservation.php
$foo = 12;
$a1 = ['foo' => &$foo];
$showa1 = function() use(&$a1) {
$bar = 100;

Fork your own Gist

This is a script that adds a fully functional Fork button to your own Gist.

If a Fork button is already present in the page, this bookmarklet will set focus to it instead of adding another one.

The change is temporary and the button will disappear as soon as you navigate away from that Gist (clicking the Fork button does this for you as well). Meaning you will have to run the script every new page load.


Copy the contents from bookmarklet.js, open Scracthpad (Ctrl+F4), paste it there. Back in browser, swwitch to tab with your Gist you want to fork. Back in Scratchpad, "Run" it. Save and/or bookmark the Scratchpad file for future use.