Skip to content

Instantly share code, notes, and snippets.

View j6s's full-sized avatar
✉️
hello@j6s.dev

Johannes Hertenstein j6s

✉️
hello@j6s.dev
View GitHub Profile
@j6s
j6s / merge_to_opus.rb
Last active June 11, 2020 01:08
merge_to_opus.rb
#!/usr/bin/env ruby
require 'digest'
#
# A script that merges multiple audio files to a single OPUS File with chapter
# markers based on the input files.
# Every input file will be one chapter in the output OPUS File.
# The ouptut file is hardcoded to be 'merged.opus'
#
# For more information about OPUS Chapter marks:
#!/usr/bin/env ruby
require 'yaml'
#
# Enables and opens the install tool of TYPO3 pages inside of a Homestead
# development box.
# - Requires a Homestead environment
# - Will fail for non-TYPO3 pages
#

Keybase proof

I hereby claim:

  • I am j6s on github.
  • I am j6s (https://keybase.io/j6s) on keybase.
  • I have a public key whose fingerprint is 1EE2 BA73 F7B6 837F 6CE5 0086 E216 E78B 4A5E 9B49

To claim this, I am signing this object:

#!/usr/bin/env ruby
require 'colorize';
@about = %q(
Removes some library file in a local steam installation in order to fix swrast driver
issues that appear because of incompatible libraries.
Usage:
fixSteam.rb [action]
#!/bin/bash
libreoffice --headless --invisible --convert-to pdf $1
#!/usr/bin/env ruby
#
# Send a notification using gnomes notification system
#
def notify(title, text)
`notify-send "#{title}" "#{text}"`
end
#
# Returns the integer value of a file
#!/bin/sh
FILE=/tmp/screen_lock.png;
# take screenshot
scrot $FILE;
# pixelate
mogrify -scale 10% -scale 1000% $FILE
var arr = [1,2,3];
// for length: the classic version
for (var i = 0; i < arr.length; i++) {
console.log(arr[i]);
}
// for of: simpler version of for length
for (var element of arr) {
console.log(element);
#!/usr/bin/env ruby
require 'colorize'
HEADER = %Q{
pdfcompress: compresses a pdf using graphicsmagick.
Author: Johannes Hertenstein
Usage:
$pdfcompress.rb $input $output [$quality]
#!/bin/bash
# http://stackoverflow.com/a/20414465
git log --shortstat --pretty="%cE" |
sed 's/\(.*\)@.*/\1/' |
grep -v "^$" | awk 'BEGIN { line=""; } !/^ / { if (line=="" || !match(line, $0)) {line = $0 "," line }} /^ / { print line " # " $0; line=""}' |
sort |
sed -E 's/# //;s/ files? changed,//;s/([0-9]+) ([0-9]+ deletion)/\1 0 insertions\(+\), \2/;s/\(\+\)$/\(\+\), 0 deletions\(-\)/;s/insertions?\(\+\), //;s/ deletions?\(-\)//' |
awk 'BEGIN {name=""; files=0; insertions=0; deletions=0;} {if ($1 != name && name != "") { print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions-deletions " net"; files=0; insertions=0; deletions=0; name=$1; } name=$1; files+=$2; insertions+=$3; deletions+=$4} END {print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions-deletions " net";}'