Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lrvick
lrvick / github-troll.md
Last active April 22, 2024 09:12
Trolling Github's DMCA repo with their own security flaws.
@QuasimodoNZ
QuasimodoNZ / extracter.py
Created February 22, 2019 02:26
Huawei Motion Picture Splitter
'''
Extract the static image and video from a motion picture taken with a Huawei phone
'''
import os
import sys
from optparse import OptionParser
// simple benchmark for reversing a string in js - source https://medium.com/quick-code/5-ways-to-reverse-a-string-in-javascript-466f62845827
function reverseFor(str){
let reversed = "";
for (var i = str.length - 1; i >= 0; i--){
reversed += str[i];
}
return reversed;
}
function reverseArray(str){
return str.split("").reverse().join("");
@NielsLeenheer
NielsLeenheer / console.hex.js
Created November 26, 2017 20:22
console.hex
console.hex = (d) => console.log((Object(d).buffer instanceof ArrayBuffer ? new Uint8Array(d.buffer) :
typeof d === 'string' ? (new TextEncoder('utf-8')).encode(d) :
new Uint8ClampedArray(d)).reduce((p, c, i, a) => p + (i % 16 === 0 ? i.toString(16).padStart(6, 0) + ' ' : ' ') +
c.toString(16).padStart(2, 0) + (i === a.length - 1 || i % 16 === 15 ?
' '.repeat((15 - i % 16) * 3) + Array.from(a).splice(i - i % 16, 16).reduce((r, v) =>
r + (v > 31 && v < 127 || v > 159 ? String.fromCharCode(v) : '.'), ' ') + '\n' : ''), ''));
@mikoim
mikoim / README.md
Last active April 6, 2024 17:34
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@ethyde
ethyde / .bash_profile
Created December 3, 2015 11:06
Bash profile load ssh-agent and add all key in ~/.ssh/id_rsa*
# SSH Agent
# Note: ~/.ssh/environment should not be used, as it
# already has a different purpose in SSH.
# source : https://www.schoonology.com/technology/ssh-agent-windows/
env=~/.ssh/agent.env
# Note: Don't bother checking SSH_AGENT_PID. It's not used
# by SSH itself, and it might even be incorrect
# (for example, when using agent-forwarding over SSH).
@dypsilon
dypsilon / backupmongodb.sh
Created April 26, 2015 21:49
Backup a mongodb in a docker container
#!/bin/bash
docker exec -t CONTAINER_NAME mongodump -out /backups/dump_`date "+%Y-%m-%d-%H-%M-%S"`
@mzedeler
mzedeler / .bashrc_ssh
Last active March 11, 2020 19:02 — forked from bluegraybox/.bashrc_ssh
bashrc snippet for initializing ssh agent and adding ssh key
#!/bin/bash
# Set up ssh-agent
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initializing new SSH agent..."
touch $SSH_ENV
chmod 600 "${SSH_ENV}"
/usr/bin/ssh-agent | sed 's/^echo/#echo/' >> "${SSH_ENV}"
@Lazza
Lazza / README.md
Last active April 16, 2024 09:36
VPNGate Python script

This script is NOT MAINTAINED

This snippet of code was posted in 2014 and slightly revised in 2016 and 2017. It was more of a quick'n'dirty script than a polished tool. It is made only for Linux and in Python 2, which has since become outdated.

I currently do not use it, and I suggest you avoid it as well. Please do not expect support for using this script.

🔥 If you need an alternative, @glaucocustodio has kindly suggested EasyVPN in this comment.

The rest of the README is left for historical purposed.

@staltz
staltz / introrx.md
Last active April 20, 2024 14:15
The introduction to Reactive Programming you've been missing