This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Instapusher. Push images from a directory automatically to Instagram. | |
# Schedule script with cron eg: | |
# 0 18 * * * /path/to/instapusher --login <your_username> \ | |
# --password <your_password> --random-delay 30 <dir> |
This file contains 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
# Extracting tabular data from pdf using Python pdfplumber together with Tesseract OCR | |
# Author Jarkko Saltiola 2021 (MIT License, Python 3.8.6) | |
# Pdfplumber, tabula, camelot and probably some other PDF parser utilities have hard | |
# time parsing tables that have column data overlapping over other columns, and | |
# probably on many other cases too. | |
# Pdfplumber gives a good level of control for splitting pdf into parts which can | |
# be read with it's methods or be passed for pytesseract as PIL image. |
This file contains 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
#!/usr/bin/env bash | |
# Connect to a dynamic NGROK endpoint that changes ofter after server restart etc. | |
# Works with single active tunnel (per account) on free tier. | |
# Provides persistent or dedicated endpoint like premium experience. | |
# Requires environment variable $NGROK_APIKEY | |
NGROK_ENDPOINT=$(curl -s https://api.ngrok.com/tunnels -H "authorization: Bearer $NGROK_APIKEY" -H "ngrok-version: 2" | jq -r '.tunnels[0].public_url') | |
NGROK_HOST=$(echo "$NGROK_ENDPOINT" | cut -d':' -f2 | cut -d'/' -f3) |
This file contains 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
# pip install selene | |
from selene import browser, by, be | |
from time import sleep | |
browser.config.base_url = 'http://127.0.0.1:7860' | |
browser.config.driver_name = 'firefox' | |
browser.open('/') |
This file contains 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
# This fan config helps to keep Thinkpad silent at work | |
# With it eg. 200$ second-hand 2-core Skylake laptop T460 and onwards can encode 1440p 30fps h264/h265 with | |
# Intel QuickSync HW encoder via proprietary VA-API driver https://wiki.debian.org/HardwareVideoAcceleration, | |
# silently, and stream it via OBS (RTMP/SRT/NDI..) etc.. | |
# To use this fan config on a single-fanned Thinkpad with Debian and systemd, run: | |
# sudo apt install thinkfan | |
# sudo echo "options thinkpad_acpi fan_control=1" > /etc/modprobe.d/thinkpad_acpi.conf |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>A simple clock</title> | |
</head> | |
<body translate="no" > |
This file contains 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
# Convert srt file (from eg. pywhispercpp) into csv format with sub start location also in seconds to create Youtube time link. | |
# Could be useful for annotating livestream recordings from transcription in a spreadsheet. | |
# Deps (Python 3.11): | |
# pip install srt | |
import csv | |
import srt | |
def srt_to_csv(srt_file, youtube_link): |
This file contains 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
<script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script> | |
<div class="gh-starred-repos"></div> | |
<script> | |
var urlToGetLatestStarredRepos = "https://api.github.com/users/jasalt/starred?per_page=10"; | |
jQuery(document).ready(function () { | |
jQuery.getJSON(urlToGetLatestStarredRepos, function (allRepos) { | |
jQuery.each(allRepos, function (i, repo) { | |
var repoUrl = jQuery('<a style="color:red;"></a>').text(repo.full_name).attr('href', repo.html_url).appendTo(".gh-starred-repos"); | |
jQuery(".gh-starred-repos").append("<label> [" + repo.description + "]</label>" + " <i><strong>" + repo.language + "</strong> ⭐ " + repo.stargazers_count + " </i> "); |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>HTML 5 Boilerplate</title> | |
<!-- <link rel="stylesheet" href="style.css"> --> | |
<script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script> | |
</head> |
This file contains 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
#!/usr/bin/env python | |
import glob | |
import os | |
import sys | |
def print_help(): | |
print(''' Replaces file shortcuts in given path with files they represent (on MacOS). | |
Directory shortcuts are skipped. Requires Python 3.10. |
NewerOlder