Skip to content

Instantly share code, notes, and snippets.

View gregglind's full-sized avatar

Gregg Lind gregglind

View GitHub Profile
@pesterhazy
pesterhazy / memorable-uuids.md
Last active August 21, 2024 20:42
A UUID to remember

In their most used version v4, UUIDs are random, and that's a useful property. But sometimes all you want is a UUID that is easy to remember. To hell with randomness!

A minor complication is that for a string to parse as a valid UUID, the variant and version bits should be set correctly (to 2 and 4, respectively). Here are a few suggestions that pass the test:

facade00-0000-4000-a000-000000000000
decade00-0000-4000-a000-000000000000
@camsjams
camsjams / guide.md
Last active May 1, 2022 16:21
How to upgrade a Node JS Express project using Swagger-Express

How to upgrade a Node JS Express project using Swagger

Migrate [swagger-express-mw] / and underlying [swagger-node-runner] to [express-openapi]

Intro

Why do this?

There have been a number of high and critical vulnerabilities caused by the npm package.

I myself have been hunting through ways to figure out how to solve these problems, as the package maintainers seem to have abandonded this library (there was even an NPM fork which still seems to have issues with bagpipes - see [swagger-node-runner year old PR]). I have created a basic guide to help others out, so that I am not just another DenverCoder9 (https://xkcd.com/979/)

[npm audit] and [snyk] scans find issues like:

@CoolOppo
CoolOppo / Cargo.toml
Last active September 15, 2024 10:55
How to compile to a DLL in rust while using it as a normal rust library
[package]
name = "test"
version = "0.1.0"
authors = ["YOU <YOU@users.noreply.github.com>"]
edition = "2018"
[lib]
crate-type = ["cdylib"]
@juanca
juanca / github_load_all_diffs.js
Created March 2, 2017 18:42
Github PR bookmarklet: Load all file diffs
javascript:
document.querySelectorAll('.load-diff-button').forEach(node => node.click())
@gregglind
gregglind / para.tags.all.ids.txt
Last active August 29, 2015 14:08
Idea for making all ids on a reports page have a para link.
/** js **/
/** or this could be in the page template, if adding an 'a' there is easier **/
/* 'after' was chosen for laziness/simplicity of styling. */
/* if you to get *all things with ids
$(".content").find("p, ul, ol, pre, h1, h2, h3, h4, h5, h6") # more restrictive
*/
$(".content").find("*").each( function (k, v) {
var id = v.id;
#! /usr/bin/python
# coding=utf-8
import cgi
import cgitb
cgitb.enable()
from datetime import datetime, timedelta
import json
import os
@staltz
staltz / introrx.md
Last active September 20, 2024 10:10
The introduction to Reactive Programming you've been missing
@rtucker-mozilla
rtucker-mozilla / gist:11186162
Created April 22, 2014 16:44
Loop iteration over an array in surveygizmo syntax
%%pageid = 1;
%%errormsg_qid = 6;
%%completed_percent = 0;
%%slider_array = array(4,7,21,22,23,24,25,26);
foreach(%%slider_array as %%slider_id){
%%completed_percent = %%completed_percent + sgapiGetValue(%%slider_id);
}
if (%%completed_percent != 100){
sgapiHideQuestion(%%errormsg_qid,false);
@ZER0
ZER0 / gist:10024431
Created April 7, 2014 17:19
Add-on SDK: to Certificate Viewer window
let { events: windowEvents } = require('sdk/window/events');
let { on } = require('sdk/event/core');
let { filter } = require('sdk/event/utils');
let ready = filter(windowEvents, ({type}) => type === 'DOMContentLoaded');
let certificateWindows = filter(ready, ({target}) =>
target.document.documentElement.mozMatchesSelector('dialog#certDetails'));
on(certificateWindows, 'data', ({target: window}) => {
@Noitidart
Noitidart / _template-BootstrapJSM.xpi
Last active July 25, 2024 13:07
ff-addon-template: Template for how to create a JSM module.