Skip to content

Instantly share code, notes, and snippets.

"""
Non blocking example:
1. Browse to `localhost:8000/sleep1`
2. Browse to `localhost:8000/`
You'll observe that the first call will take 5 seconds and the second call will be executed immediately.
Blocking example:
1. Browse to `localhost:8000/sleep2`
2. Browse to `localhost:8000/`
@u1i
u1i / doit.txt
Created June 21, 2021 11:28
pdftk MacOs M1
https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg
@alfg
alfg / README.md
Last active February 16, 2024 08:34
MP4 Parser example in Go.

Minimal MP4 Parser Example

  • Download MP4: https://github.com/alfg/mp4/blob/master/test/tears-of-steel.mp4?raw=true
  • Run
go run mp4_example.go tears-of-steel.mp4

go run mp4_example_2.go tears-of-steel.mp4
@joshskidmore
joshskidmore / img-url-exif.sh
Last active February 15, 2024 15:14
img-url-exif.sh
#!/usr/bin/env bash
# Josh Skidmore <josh@josh.sc>
# Basic example of using an HTTP range header to extract EXIF data
# from a JPEG file without having to download the entire image.
# This has no error handling and assumes the EXIF data is embedded
# within the first $KB_TO_DOWNLOAD kilobytes of the image
# Requirements:
# * curl
@fracasula
fracasula / encrypt_decrypt.go
Last active June 25, 2024 07:13
A simple example with Golang that uses AES-128 to encrypt and decrypt messages.
package mycrypto
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"io"
"time"
)
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active July 3, 2024 11:22
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@tsuchm
tsuchm / base62.pl
Created March 8, 2018 01:48
Perl encode/decoder of base62 format
use constant PRIMITIVES => join( '', 0 .. 9, 'a' .. 'z', 'A' .. 'Z' );
sub encode_base62 {
my( $num ) = @_;
my @c;
do {
push( @c, substr( PRIMITIVES, $num % length(PRIMITIVES), 1 ) );
$num = int( $num / length(PRIMITIVES) );
} while( $num );
join( '', reverse @c );

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@owulveryck
owulveryck / main.go
Last active July 26, 2023 17:00
http proxy that logs...
package main
import (
"flag"
"fmt"
"io"
"log"
"net/http"
"net/http/httputil"
"net/url"
@juris
juris / redis-cluster-backup.sh
Last active March 21, 2023 14:27
Redis Cluster backup script
#!/bin/sh
readonly cluster_topology=$(redis-cli -h redis-cluster cluster nodes)
readonly slaves=$(echo "${cluster_topology}" | grep slave | cut -d' ' -f2,4 | tr ' ' ',')
readonly backup_dir="/opt/redis-backup"
mkdir -p ${backup_dir}
for slave in ${slaves}; do
master_id=$(echo "${slave}" | cut -d',' -f2)