Skip to content

Instantly share code, notes, and snippets.

@koutoftimer
koutoftimer / die.sh
Created March 27, 2024 13:42 — forked from alexanderankin/die.sh
Bash Die Function
function die () {
local message=$1
[ -z "$message" ] && message="Died"
echo "$message (at ${BASH_SOURCE[1]}:${FUNCNAME[1]} line ${BASH_LINENO[0]}.)" >&2
exit 1
}
@koutoftimer
koutoftimer / .tmux.conf
Created January 5, 2023 11:49 — forked from william8th/.tmux.conf
Tmux open new pane in same directory
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B)
set -g prefix C-space
unbind-key C-b
bind-key C-space send-prefix
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
@koutoftimer
koutoftimer / Clickpocalypse-2-idle.js
Last active March 4, 2024 06:38
Clickpocalypse 2 automation script
// Usage: run this script in your browser.
//
// By default it doesn't starts automatically. You have to run `turn_on()` function
// or start each module indivitually `auto_<name>.start()`.
// `turn_off()` and `auto_<name>.stop()` does the oposite.
// `modules_preset` defines set of modules to be handled by `turn_*` functions.
//
// ------------------------------------------
// -- Utility
@koutoftimer
koutoftimer / fast-torrent-sorter.sh
Created September 11, 2021 15:41
Load and sort torrent list at fast-torrent.ru without waiting for page to fully load
#!/usr/bin/env bash
# Usage: fast-torrent-sorter <URL>
# or: fast-torrent-sorter
#
# Required software and tools:
# * `wget` or `curl` - to load torrent list
# * `xclip` - fallback in case if no arguments provided
# * `xdg-open` - to be more generic about default browser
#
# kind of standard:
@koutoftimer
koutoftimer / Cargo.toml
Last active September 7, 2020 13:49
Test available backends for wgpu
[dependencies]
wgpu = "0.6.0"
@koutoftimer
koutoftimer / README.md
Created February 16, 2019 07:19
Clipboard to QR code

Generates QR code from clipboard as PNG image and displays in default viewer. Usefull if you want to open link on you smartphone.

Installation

  • First of all you need to install python.
  • Then install dependencies python -m pip install -r requirements.txt.
  • Make qr.py easy to reach.
@koutoftimer
koutoftimer / README.md
Last active October 24, 2018 14:09
Extract *.m3u8 playlist urls from link to anime page on online.anidub.com

Скрипт позволяет создать плейлист в формате \*.m3u для просмотра аниме с https://online.anidub.com/

Использование

Для создания плейлиста нужно выполнить скрипт с двумя параметрами: ссылку на страницу аниме (например [это][1]) и путь куда сохранять плейлист (например /tmp/pl.m3u). Команда будет иметь вид

$ python3 extract.py --output pl.m3u \
    --url "https://online.anidub.com/anime/10415-galakticheskie-zheleznye-dorogi-ginga-tetsudou-monogatari-01-iz-26.html"
@koutoftimer
koutoftimer / bot.js
Created September 20, 2018 20:57
Computer Evolution automation
window.bot = function() {
let bot = {};
bot.init = function init() {
let selectButton = document.createElement('button')
, selectEl = document.createElement('select');
initElements();
appendBody();
addEvents();
@koutoftimer
koutoftimer / index.html
Created April 16, 2018 20:05
Index template
{% extends 'base.html' %}
{% load static %}
{% block title %}{{ index.title }}{% endblock %}
{% block head %}
<style>
html {
background: {{ index.bg_color }} url("{{ index.image.url }}") no-repeat center fixed;
background-size: cover;
@koutoftimer
koutoftimer / tmux.conf
Created March 7, 2018 13:47
tmux configuration file
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
# Change <command> key
unbind C-b
set -g prefix `
# Send "`" to the terminal by double pressing command key <`>
set-option -g prefix `