Skip to content

Instantly share code, notes, and snippets.

View Akkuma's full-sized avatar

Greg W Akkuma

View GitHub Profile
@abstractvector
abstractvector / Dockerfile
Last active April 25, 2023 13:57
Lightweight node.js Dockerfile
ARG ALPINE_VERSION=3.11
ARG NODE_VERSION=15.5.1
##########################
# Cache-preserving image #
##########################
FROM alpine:${ALPINE_VERSION} AS deps
RUN apk --no-cache add jq
@Tenzer
Tenzer / 000-README.md
Last active January 18, 2024 07:02
LastPass Pwned Passwords checker

LastPass Pwned Passwords checker

This is a script for checking if any of the passwords you have stored in LastPass have been exposed through previous data breaches.

To use the script you need to have Python 3 installed and you need a CSV export of your LastPass vault. The export can be generated from the LastPass CLI with:

lpass export > lastpass.csv

or can be extracted with the browser plugin by going to the LastPass icon → More Options → Advanced → Export → LastPass CSV File (note that I did have problems getting this to work).

@troyfontaine
troyfontaine / 1-setup.md
Last active March 27, 2024 01:43
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@nybblr
nybblr / 1-easy.js
Last active July 13, 2022 03:40
3 examples of using Async Generators and Async Iteration in JavaScript!
// Create a Promise that resolves after ms time
var timer = function(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
};
// Repeatedly generate a number starting
// from 0 after a random amount of time
var source = async function*() {
@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active March 28, 2024 12:37
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);
@alexhawkins
alexhawkins / HashTable.js
Last active August 7, 2021 23:33
Correct Implementation of a Hash Table in JavaScript
var HashTable = function() {
this._storage = [];
this._count = 0;
this._limit = 8;
}
HashTable.prototype.insert = function(key, value) {
//create an index for our storage location by passing it through our hashing function
var index = this.hashFunc(key, this._limit);
@naholyr
naholyr / 1-line.sh
Last active August 17, 2017 18:12
Add "use strict" everywhere
find -name '*.js'|grep -v '^./node_modules'|while read f;do if (head -n3 "$f"|grep -Fv 'use strict'>/dev/null);then echo "$f";sed -i -e '1i "use strict"\n' "$f";fi;done