Skip to content

Instantly share code, notes, and snippets.

@taoyuan
taoyuan / generate_self_signed_certification.md
Last active April 26, 2024 21:48
Generation of a Self Signed Certificate

Generation of a Self Signed Certificate

Generation of a self-signed SSL certificate involves a simple 3-step procedure:

STEP 1: Create the server private key

openssl genrsa -out cert.key 2048

STEP 2: Create the certificate signing request (CSR)

openssl req -new -key cert.key -out cert.csr
@sfoster
sfoster / gist:9c9230cba4e4cff1eb88423cd9547e51
Created November 26, 2018 23:40
Some form autofill scratchpad code to enter some test addresses and credit card details
/*
* This is a JavaScript Scratchpad.
*
* Enter some JavaScript, then Right Click or choose from the Execute Menu:
* 1. Run to evaluate the selected text (Ctrl+R),
* 2. Inspect to bring up an Object Inspector on the result (Ctrl+I), or,
* 3. Display to insert the result in a comment after the selection. (Ctrl+L)
*/
const cardBobsVisa = {
@hotsoft-desenv2
hotsoft-desenv2 / AppConstants.jsm
Created June 26, 2020 16:02
resource://gre/modules/AppConstants.jsm
/* 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/. */
/* eslint mozilla/use-services:off */
var EXPORTED_SYMBOLS = ["Services"];
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
@mostlygeek
mostlygeek / firefox-heartbeat.js
Created September 6, 2018 23:38
Manually triggering normandy's show-heartbeat action w/ the Fx browser console
// copy + paste these commands into the browser console to trigger
// the heartbeat pop up
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://normandy/lib/Heartbeat.jsm");
ChromeUtils.import("resource://normandy/lib/SandboxManager.jsm");
const recentWindow = Services.wm.getMostRecentNonPBWindow("navigator:browser");
const sm = new SandboxManager();
new Heartbeat(recentWindow, sm, {flowId: "test",
@wellington1993
wellington1993 / Loader.jsm
Created January 11, 2020 00:14
resource://devtools/shared/Loader.jsm
/* 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";
/**
* Manages the base loader (base-loader.js) instance used to load the developer tools.
*/
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 26, 2024 21:46
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser! If you absolutely need to use browser instead of desktop app, use an extension to add the string Electron/ anywhere in your user-agent.

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
@davidteren
davidteren / nerd_fonts.md
Last active April 26, 2024 21:46
Install Nerd Fonts via Homebrew [updated & fixed]
@ncalexan
ncalexan / bu.js
Created September 15, 2020 22:35
"use strict";
// Copied form
// taskcluster/docker/periodic-updates/scripts/getHSTSPreloadList.js,
// which simplified a version from
// browser/components/migration/MigrationUtils.jsm.
function spinResolve(promise) {
if (!(promise instanceof Promise)) {
return promise;
}
"use strict";
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
const { ProcessorBase } = ChromeUtils.import("resource://rewrites/Processor.jsm");
const { Replacer } = ChromeUtils.import("resource://rewrites/Replacer.jsm");
const { Parser, NodeWalker } = ChromeUtils.import("resource://rewrites/Parser.jsm");
var EXPORTED_SYMBOLS = ["Processor"];
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="localized.js"></script>
</head>
<body>
</body>
</html>