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
#!/bin/sh | |
# Save this somewhere and call it in a loop of your choice, e.g. | |
# find -name 'scripts.inc' -exec ./inc_to_pory.sh {} \; | |
# to wrap all `scripts.inc` files in raw blocks and rename them to pory or | |
# find -name '*.inc' -exec ./inc_to_pory.sh {} \; | |
# to do the same with *all* .inc scripts in the current folder or subfolders. | |
f="$(echo $1 | rev | cut -c 5- | rev)" | |
echo 'raw `' >> "$f.pory" |
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
import kotlin.math.min | |
object start { | |
infix fun to(other: Int) = RangeTuple(0, other) | |
infix fun to(other: end) = RangeTuple(0, Int.MAX_VALUE) | |
} | |
object end | |
infix fun Int.to(other: end) = RangeTuple(this, Int.MAX_VALUE) |
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
#!/bin/bash | |
# | |
# Original: https://github.com/Nyr/openvpn-install | |
# | |
# Copyright (c) 2013 Nyr. Released under the MIT License. | |
# Minor changes by kageru to make the script run on Arch. | |
if [[ "$EUID" -ne 0 ]]; then | |
echo "Sorry, you need to run this as root" | |
exit |
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
#!/bin/bash | |
# Move/rename a file/folder and change all m3u playlists in $playlists accordingly | |
# Usage: | |
# $ mv3u old_filename "new filename" | |
# change this | |
playlists='/path/to/your/playlists' | |
src="$1" |
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 python3 | |
""" | |
Just very basic for now. It only prints an mkvmerge command. | |
TODOs: | |
- properly get input file (or get it at all, lul) | |
- do the splitting for the user | |
- actually parse vs scripts | |
- get delay from source file (and --sync the output) | |
- add pluses automatically so you only get one file |
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
from random import randint | |
from functools import partial | |
def d(m, n=1): | |
s = 0 | |
print(f'{n}d{m}') | |
for _ in range(n): | |
r = randint(1, m) | |
s += r | |
print(r) |
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
import strutils | |
import future | |
import nre | |
# 3-dimensional vector type with attributes for x, y, and z | |
# Mainly used for readability | |
type Vector = object | |
x, y, z: int |
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
import tables | |
import nre | |
import strutils | |
let pattern = re"(?<target>\w+)\s(?<opcode>(inc|dec))\s(?<value>-?\d+)\sif\s(?<comptarget>\w+)\s(?<compop>(<|>|==|!=|<=|>=))\s(?<comp2>-?\d+)" | |
var registers = initTable[string, int](); | |
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
import sequtils | |
import future | |
import nre except toSeq | |
type | |
Direction = enum | |
up = 0, left = 1, down = 2, right = 3 | |
Grid = seq[seq[char]] |
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 python3.6 | |
"""Snap start and end times of ASS subtitles to scene changes using WWXD. | |
Does not work with variable frame rate (VFR). | |
usage: snap_scenechanges.py [-h] [--epsilon EPSILON] [-o OUTPUT] [-v] | |
sub_path video_path |
NewerOlder