This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am receptor on github. | |
* I am sebp (https://keybase.io/sebp) on keybase. | |
* I have a public key ASBlTt0ie4yELLDigD6AcIH-B-AqIIlEONlZEZ2MnwRp4Qo | |
To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.on("SIGINT", () => process.exit()); | |
import * as bodyParser from "body-parser"; | |
import express from "express"; | |
import redis from "redis"; | |
// logger | |
const now = () => new Date().toISOString(); | |
const loggerFacility = console; | |
const logger = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install ffmpeg | |
cd /path/to/flac | |
for i in *.flac; do ffmpeg -i "$i" -vn -c:a alac "$(basename "$i" .flac).m4a"; done; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENCRYPT | |
$ echo "my secret message" | openssl aes-256-cbc -a -salt | |
enter aes-256-cbc encryption password: | |
Verifying - enter aes-256-cbc encryption password: | |
U2FsdGVkX19T5h74/9HOtWBX4WoIggVKksYf7L1WBso= | |
DECRYPT | |
$ echo "U2FsdGVkX19T5h74/9HOtWBX4WoIggVKksYf7L1WBso=" | openssl aes-256-cbc -a -d -salt | |
enter aes-256-cbc decryption password: | |
my secret message |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am receptor on github. | |
* I am sebp (https://keybase.io/sebp) on keybase. | |
* I have a public key ASBlTt0ie4yELLDigD6AcIH-B-AqIIlEONlZEZ2MnwRp4Qo | |
To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Reference | |
Many will know this already, but I need to make sure you know it because it’s so fundamental. | |
A ‘reference’ is a string that points to a commit. | |
There are four main types of reference: HEAD, Tag, Branch, and Remote Reference. | |
HEAD | |
HEAD is a special reference that always points to where the git repository is. | |
If you checked out a branch, it’s pointed to the last commit in that branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usage | |
// const obj = /* ... */; | |
// const sc = await jsclone.structuralClone(obj); | |
// const c = jsclone.clone(obj); | |
moudule.exports = { | |
structuralClone(obj) => { | |
return new Promise(resolve => { | |
const {port1, port2} = new MessageChannel(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM Administrative check from here: https://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights | |
REM Vaccination discovered by twitter.com/0xAmit | |
REM Batch file created by Lawrence Abrams of BleepingComputer.com. @bleepincomputer @lawrenceabrams | |
echo Administrative permissions required. Detecting permissions... | |
echo. | |
net session >nul 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Full version of `log` that: | |
// * Prevents errors on console methods when no console present. | |
// * Exposes a global 'log' function that preserves line numbering and formatting. | |
(function () { | |
var method; | |
var noop = function () { }; | |
var methods = [ | |
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', | |
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', | |
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use the browser's built-in functionality to quickly and safely escape the string | |
function escapeHtml(str) | |
{ | |
var div = document.createElement('div') | |
div.appendChild(document.createTextNode(str)) | |
return div.innerHTML | |
} | |
// UNSAFE with unsafe strings; only use on previously-escaped ones! | |
function unescapeHtml(escapedStr) |
NewerOlder