Skip to content

Instantly share code, notes, and snippets.

@aandergr
aandergr / instaloader_mass_rename.py
Created August 30, 2018 07:16
Mass rename files in your local Instagram archive according to a new filename pattern
import argparse
import glob
import os
import re
import sys
import instaloader
def json_type(filename: str):
@pavelkryukov
pavelkryukov / updgrade-instaloader-images.py
Last active September 28, 2019 10:52
This script finds local versions of images fetched by InstaLoader.
#!/usr/bin/python
# Copyright (C) Pavel Kryukov 2017
from PIL import Image
import imagehash
import os
import shelve
import shutil
import re
import argparse
from tqdm import tqdm
@powerswitch
powerswitch / ET6202.ino
Last active May 2, 2024 22:50
Arduino code for ET6202 LED driver chip
// Connect your ET6202 pins and adapt constants below accordingly
const int kPinStb = 4; // Serial interface command mode port
const int kPinClk = 3; // Clock input port
const int kPinData = 2; // Data input and output port
/**
* Command (aka Order) to send to the chip.
*/
enum Order {
@Thammus
Thammus / bash_aliases.sh
Last active July 19, 2016 16:47
some useful bash aliases and functions
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" \
"$(history|tail -n1|sed -e '\''s/^\s *[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias ls='ls --color=auto'
pid() {
ps -e | sed -n "s/^[^0-9]*\([0-9]*\).*""$1"".*\$/\1/p"
}
@aandergr
aandergr / queryocl.c
Created July 19, 2016 07:35
Print some OpenCL parameters of all available devices
/* Print some OpenCL parameters of all available devices.
*
* Compile with
* cc -o queryocl queryocl.c -lOpenCL
* eventually you need to pass -I and -L options.
*
* Then call with
* ./queryocl
*/