Skip to content

Instantly share code, notes, and snippets.

View SamusAranX's full-sized avatar

SamusAranX

  • Germany
  • 11:47 (UTC +02:00)
View GitHub Profile
@SamusAranX
SamusAranX / ytp-rgb-stretcher.css
Last active July 23, 2022 09:35
RGB Stretcher for YouTube
video.video-stream.html5-main-video {
/*transition: .5s filter ease;*/
}
body.ytp-rgb-stretcher video.video-stream.html5-main-video {
filter: url(#yt-rgb-fix);
}
@keyframes ytp-rgb-fadein {
0% { opacity: 0; }
100% { opacity: 1; }
@SamusAranX
SamusAranX / BARS format (to the best of my knowledge).txt
Last active October 18, 2023 23:03
BARS extractor (with improvised documentation)
IMPORTANT: All offsets are taken from KorokPot.bars! Actual offsets of dynamic-length data may vary in other files, but based
on the information here, it shouldn't be hard to find the real offsets. When in doubt, look at the code.
╒══════════╤══════════╤═════════╤════════════════════╤═══════════╤═════════════════════════╤════════════════════════════════════════════════════════════════════════╕
│ Offset │ -> Dec │ Size │ -> Dec │ Type │ Name │ Information │
╞══════════╪══════════╪═════════╪════════════════════╪═══════════╪═════════════════════════╪════════════════════════════════════════════════════════════════════════╡
│ 0x0 │ 0 │ 0x4 │ 4 │ │ BARS header │ Indicates that this is, in fact, a BARS file │
├──────────┼──────────┼─────────┼────────────────────┼───────────┼─────────────────────────┼────────────────────────────────────
@SamusAranX
SamusAranX / apachelisting
Last active September 28, 2017 23:42
A little bash snippet to download Apache directory listings while circumventing robots.txt rules and simple user-agent blocks. This script also uses Python 3 to adjust the --cut-dirs value to avoid folder clutter.
function apachelisting() {
CUT_DIRS=$(python3 -c "from urllib.parse import urlparse; import sys; print(len([d for d in urlparse(sys.argv[1]).path.split('/') if d]))" "$1")
wget -r --no-parent --reject "index.html*" -e robots=off --restrict-file-names=nocontrol --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0" -nH --cut-dirs="$CUT_DIRS" "$1"
}
# usage: apachelisting http://someserver.tld/ftp/a/bunch/of/folders/
# this will recursively download everything from that directory listing and cut unnecessary folders away
# for example, http://someserver.tld/ftp/a/bunch/of/folders/stuff.zip will become ./stuff.zip on your machine
# likewise, http://someserver.tld/ftp/a/bunch/of/folders/evenmorefolders/junk.rar will become ./junk.rar
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
# usage: Put a bunch of fonts into a folder named like the font next to this script
# Do this: ./fontprofile.py "<FONT NAME>"
# There should now be a <FONT NAME>.mobileconfig file in the script's folder
# Don't pack too many fonts at once, iOS will complain if the file is too large
# The maximum file limit seems to be different on every iOS device, so YMMV
# Also, there are some font files (mostly exotic ones) that this script has problems with
# I think this is an encoding problem, but it mostly shouldn't be a problem
@SamusAranX
SamusAranX / GetTerminalColors.swift
Last active August 7, 2016 23:53
Run this in a Swift playground with the .terminal profile that you want to parse in the playground's Resources folder. I wrote this because I wanted to copy the colors of an OS X terminal theme to my Linux Mint terminal but couldn't find a way to list all the colors in a .terminal file.
import Cocoa
extension NSColor {
var hexString: String {
if let convertedColor = self.colorUsingColorSpaceName(NSCalibratedRGBColorSpace) {
var redFloat: CGFloat = 0.0, greenFloat: CGFloat = 0.0, blueFloat: CGFloat = 0.0
convertedColor.getRed(&redFloat, green: &greenFloat, blue: &blueFloat, alpha: nil)
// the decimals are for when the cast to Int floor()s the floats, don't worry about it
let redInt = Int(redFloat * 255.99999),
@SamusAranX
SamusAranX / unpack_binarymeshdata.py
Last active March 25, 2018 03:25
This script converts .babylonbinarymeshdata files (such as the ones used in Microsoft's Xbox Design Lab) to usable .obj files.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import io
import sys
import glob
import json
import struct
import argparse
@SamusAranX
SamusAranX / termcolors.py
Created June 15, 2016 09:33
wttr.in Today widget for Pythonista 3
def get_colors():
return [(0, 0, 0), (0.9725490196078431, 0.1607843137254902, 0.2235294117647059), (0.23137254901960785, 0.9176470588235294, 0.16470588235294117), (0.984313725490196, 0.7529411764705882, 0.27450980392156865), (0.43529411764705883, 0.3058823529411765, 0.7333333333333333), (0.17647058823529413, 0.27058823529411763, 0.3843137254901961), (0.38823529411764707, 0.796078431372549, 0.8862745098039215), (0.5137254901960784, 0.5490196078431373, 0.5843137254901961), (0.27058823529411763, 0.27450980392156865, 0.25098039215686274), (0.9647058823529412, 0.1607843137254902, 0.2235294117647059), (0.23137254901960785, 0.9137254901960784, 0.16470588235294117), (0.9803921568627451, 0.7529411764705882, 0.27450980392156865), (0.43137254901960786, 0.3058823529411765, 0.7333333333333333), (0.17647058823529413, 0.27058823529411763, 0.3843137254901961), (0.3843137254901961, 0.796078431372549, 0.8862745098039215), (0.5098039215686274, 0.5450980392156862, 0.5803921568627451), (0.0, 0.0, 0.0), (0.0, 0.0, 0.2), (0.0, 0.0