Skip to content

Instantly share code, notes, and snippets.

View jxu's full-sized avatar
:shipit:
If it compiles it ships

jxu

:shipit:
If it compiles it ships
  • Wit's End
View GitHub Profile
# audo quality 0-9 https://trac.ffmpeg.org/wiki/Encode/MP3
for f in *.flac; do ffmpeg -i "$f" -c:a libmp3lame -q:a 2 "${f/%flac/mp3}"; done
@jxu
jxu / rename_videos_test.sh
Last active January 28, 2020 08:26
rename videos based on youtube-dl JSON info
for f in *.json
do
pi=$(jq .playlist_index < "$f")
pi=$(printf %03d $pi)
d=$(jq -r .upload_date < "$f")
b=$(basename "$f" .info.json)
for ff in "$b"*
do
mv -v "$ff" "$pi $d $ff"
@jxu
jxu / project_euler_md5.txt
Created February 24, 2020 20:47
Hashed solutions of Project Euler problems
e1edf9d1967ca96767dcc2b2d6df69f4
4194eb91842c8e7e6df099ca73c38f28
94c4dd41f9dddce696557d3717d98d82
d4cfc27d16ea72a96b83d9bdef6ce2ec
bc0d0a22a7a46212135ed0ba77d22f3a
867380888952c39a131fe1d832246ecc
8c32ab09ec0210af60d392e9b2009560
0f53ea7949d32ef24f9186207600403c
24eaa9820350012ff678de47cb85b639
d915b2a9ac8749a6b837404815f1ae25
\[FormalA]
\[FormalB]
\[FormalC]
\[FormalD]
\[FormalE]
\[FormalF]
\[FormalG]
\[FormalH]
\[FormalI]
\[FormalJ]
@jxu
jxu / ublacklist.txt
Created July 8, 2020 19:53
C/C++ google search blocklist of low quality sites, for use with uBlacklist
*://www.tutorialspoint.com/*
*://www.geeksforgeeks.org/*
*://www.w3schools.com/*
*://www.programiz.com/*
*://www.techonthenet.com/*
*://fresh2refresh.com/*
*://www.quora.com/*
*://www.researchgate.net/*
*://www.w3resource.com/*
*://www.improgrammer.net/*
@jxu
jxu / render_all_build.conf
Created October 20, 2020 05:15
RDF/ORE mapcrafter conf files
output_dir = render_build
[global:map]
render_view = topdown
texture_size = 4
[global:world]
default_view = 0,0,64
default_zoom = 5
@jxu
jxu / control.lua
Last active January 8, 2023 23:53 — forked from Bilka2/control.lua
Create a timelapse from a factorio replay save file
-- Just add this to the end of the control.lua file in the save file and then replay the file
script.on_nth_tick(1800, function(event)
game.take_screenshot{
surface = game.surfaces[1],
position = {0,0},
resolution = {3840,2160},
zoom = 0.2,
path = "timelapse/" .. string.format("%06d", event.tick/event.nth_tick) .. ".jpg",
quality = 95,
@jxu
jxu / download_panopto.sh
Last active August 17, 2022 05:27
Download panopto videos from podcast file (from https://github.com/jstrieb/panopto-download/issues/3)
# requires xq with --raw output support (https://github.com/boyska/xq fork)
xq -r '//item/enclosure/@url' Podcast.ashx | wget -i -
@jxu
jxu / setup_github_repo
Last active June 16, 2022 20:52
Github idiotically uses main instead of master branch
git remote add origin [email protected]:jxu/repo.git # use set-url if already set
git push -u origin master
@jxu
jxu / download-youtube-podcast
Created July 14, 2022 23:44
48k m4a with SponsorBlock
yt-dlp -f129 --sponsorblock-remove sponsor $url