Skip to content

Instantly share code, notes, and snippets.

Avatar
📱
Working

Quentin Dreyer qkdreyer

📱
Working
View GitHub Profile
View Makefile
all:
gcc -o tislaunchd tislaunchd.m -framework appkit -framework carbon
install:
chmod u+x tislaunchd
cp tislaunchd /tmp
sudo cp dev.qkdreyer.tislaunchd.plist /Library/LaunchDaemons/
sudo launchctl load /Library/LaunchDaemons/dev.qkdreyer.tislaunchd.plist
uninstall:
@qkdreyer
qkdreyer / Makefile
Last active Sep 1, 2021
NSPasteboard + launchd
View Makefile
all:
gcc -o nspasteboardlaunchd nspasteboardlaunchd.m -framework appkit
install:
chmod u+x nspasteboardlaunchd
cp nspasteboardlaunchd /tmp
sudo cp dev.qkdreyer.nspasteboardlaunchd.plist /Library/LaunchDaemons/
sudo launchctl load /Library/LaunchDaemons/dev.qkdreyer.nspasteboardlaunchd.plist
uninstall:
@qkdreyer
qkdreyer / grevby.sh
Last active Feb 23, 2020
Git Reviewed By
View grevby.sh
#!/bin/sh
git config --global alias.revby "interpret-trailers --trailer \"Reviewed-by: $(git config user.name) <$(git config user.email)>\" --in-place"
git rebase @ --exec 'GIT_EDITOR="git revby" git commit --amend'
@qkdreyer
qkdreyer / pkcs12.sh
Created Feb 17, 2020
OpenSSL PFX to PEM
View pkcs12.sh
#!/bin/sh
openssl pkcs12 -in *.p12 -cacerts -nokeys | openssl x509 -out ca.pem
openssl pkcs12 -in *.p12 -clcerts -nokeys | openssl x509 -out cert.pem
openssl pkcs12 -in *.p12 -nocerts -nodes | openssl rsa -out key.pem
View gist:3e5c7e7f263cf7a1294c4c5ba9498c36
Non Breaking Space Character
/[\u00A0]+/
Base Combining Characters
/[\u0300-\u036F]+/
@qkdreyer
qkdreyer / cloudSettings
Last active Mar 9, 2020
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2020-03-09T19:56:45.862Z","extensionVersion":"v3.4.3"}
@qkdreyer
qkdreyer / Y.js
Created Jun 9, 2018
ES6 Y Combinator One Liner
View Y.js
// http://kestas.kuliukas.com/YCombinatorExplained/
// https://rosettacode.org/wiki/Y_combinator#JavaScript
//
// const factorial = Y(next => (n) => {
// if (n < 2) return 1;
// return n * next(n - 1);
// });
// console.log(factorial(5)); // 120
const Y = f => (...args) => f(Y(f))(...args);
@qkdreyer
qkdreyer / _.toObjectURL.js
Last active Mar 1, 2018
Lodash/Underscore dataURI/base64/string/typedArray to objectURL mixin
View _.toObjectURL.js
_.mixin({
dataURIToObjectURL(dataURI) {
return this.blobToObjectURL(this.dataURIToBlob(dataURI));
},
base64ToObjectURL(base64, type) {
return this.blobToObjectURL(this.base64ToBlob(base64, type));
},
stringToObjectURL(string, type) {
return this.blobToObjectURL(this.stringToBlob(string, type));
},
@qkdreyer
qkdreyer / crypto-loot.js
Last active Nov 26, 2017
Crypto Loot Script
View crypto-loot.js
(function(doc, tag, cb) {
var js = doc.createElement(tag), ref = doc.getElementsByTagName(tag)[0];
js.async = true;
js.onload = js.onreadystatechange = function(_, isAbort) {
if (isAbort || !js.readyState || /loaded|complete/.test(js.readyState)) {
js.onload = js.onreadystatechange = null;
js = undefined;
!isAbort && cb && cb();
}
};
View gist:7aa37e0256694919d735732f00f53904
CREATE DATABASE `db`;
GRANT ALL PRIVILEGES ON `db`.* TO `user`@`localhost` IDENTIFIED BY `password` WITH GRANT OPTION; FLUSH PRIVILEGES;