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
# Not sure exacty which are needed, this worked | |
sudo apt install abcde id3 id3v2 eyed3 normalize-audio vorbisgain mkcue ffmpeg flac | |
# Rip CD, output a cue file with timestamps | |
abcde -1 -o flac -a default,cue,playlist | |
# -vf pad is if ffmpeg complains about image not having proportions divisible by 2, adds one pixel black padding | |
ffmpeg -loop 1 -i IMAGE.jpg -i ALBUM.flac -c:v libx264 -c:a copy -shortest -vf pad="width=ceil(iw/2)*2:height=ceil(ih/2)*2" -strict -2 ALBUM.mp4 |
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
const imageLoader = { | |
/** | |
* Load a list of img URLs then resolve a Promise | |
* | |
* @param {String[]} urls images to load | |
* @param {Number} [retries=0] number of times to retry on img.onerror | |
* @return {Promise<HTMLImageElement[]|String>} return the loaded image elements in preserved order, or the first URL to fail on rejection | |
*/ | |
loadImages(urls, retries = 0) { |
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 node | |
const fs = require('fs'); | |
if(process.argv.length < 4) { | |
console.error('Usage:', 'node check-size.js file size'); | |
process.exit(1); | |
} | |
const file = process.argv[2]; |
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
for i in {01..21}; do zip -j -r "ComicName$i.cbz" "Chapter$i"; done |
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
# Example: npm unpublish the-package from 0.5.31 to 0.5.41 | |
for i in $(seq 31 41); do npm unpublish "the-package@0.5.$i"; done | |
# list available versions of the-package: | |
npm show the-package versions |
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
perl -pi -e 's/(width|height|margin-?\w*|padding-?\w*|font-size): ([\d+\.])(vw|vh|%|px)/"$1: ".sprintf("%.2f", $2*(1\/0.85)).$3/e' file.css |
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 | |
/usr/bin/find ~/Workspace -mindepth 1 -maxdepth 1 -type d -print -exec /usr/bin/git -C {} pull --ff-only --all \; |
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
package io.github.kribblo.ip; | |
import java.net.*; | |
import java.util.Collections; | |
public class SiteLocalIp { | |
public static String getSiteLocalIp() throws SocketException, UnknownHostException { | |
return Collections.list(NetworkInterface.getNetworkInterfaces()).stream() | |
.filter(SiteLocalIp::isValidInterface) | |
.flatMap(i -> Collections.list(i.getInetAddresses()).stream()) |
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
## Inspired by https://gist.github.com/Pencroff/69ebdd4d57ad11b2eaba | |
## file name transformation | |
## file-name => FileName | |
## Sources: | |
## http://stackoverflow.com/questions/6998412/velocity-string-function | |
## http://stackoverflow.com/questions/21288687/using-velocity-split-to-split-a-string-into-an-array-doesnt-seem-to-work | |
## http://velocity.apache.org/engine/releases/velocity-1.7/apidocs/org/apache/velocity/util/StringUtils.html#split(java.lang.String, java.lang.String) | |
## File and Code Templates -> Includes -> Save as "CamelCase" | |
#set( $camelCaseName = "" ) |
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
'use strict'; | |
/** | |
* @exports sizeFactory | |
* @private | |
* | |
* @param {{width: number, height: number}} size | |
* @returns {sizeHelper} | |
*/ | |
function sizeFactory(size) { |
NewerOlder