Skip to content

Instantly share code, notes, and snippets.

@Convicted202
Convicted202 / conv.sh
Created March 24, 2018 09:29 — forked from blairanderson/conv.sh
Optimize Videos for Web - Compress MP4 and remove Audio with FFMPEG. encodes as 264 with CRF 30, scales down to 1920x1080, strips audio
#! /bin/bash
# The Purpose of this Script is to batch convert and compress any video file to mp4 format
#
# WARNING: LOSSY COMPRESSION !!!
# Variable used:
# sourcedir is the directory where to be converted videos are. Converted video will be saved in the same folder
# usage:
@Convicted202
Convicted202 / crypto-pbkdf2-example.js
Created April 23, 2017 20:58 — forked from skeggse/crypto-pbkdf2-example.js
Example of using crypto.pbkdf2 to hash and verify passwords asynchronously, while storing the hash and salt in a single combined buffer along with the original hash settings
var crypto = require('crypto');
// larger numbers mean better security, less
var config = {
// size of the generated hash
hashBytes: 32,
// larger salt means hashed passwords are more resistant to rainbow table, but
// you get diminishing returns pretty fast
saltBytes: 16,
// more iterations means an attacker has to take longer to brute force an
@Convicted202
Convicted202 / function-web-worker.js
Created March 15, 2017 12:27 — forked from westonruter/function-web-worker.js
Spawning a web worker from a function object (bypassing need for separate JS file)
function fibonacci(){ /*...*/ }
var worker = new Worker(
"data:application/javascript;base64,"+
btoa('(' + fibonacci.toString().replace(/function\s+\w+/, 'function') + ')();')
);
// More: https://plus.google.com/113853198722136596993/posts/hAtcYGc5xcw
@Convicted202
Convicted202 / 0_reuse_code.js
Created July 28, 2016 12:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Convicted202
Convicted202 / main.js
Created July 19, 2016 14:12 — forked from husa/xml2react.js
XML to React Component
const xml = `
<XMLText class="yeah-attributes">
regular text
<XMLBold>
bold text
</XMLBold>
another text
</XMLText>
`;