Skip to content

Instantly share code, notes, and snippets.

Johannes Hertenstein j6s

Block or report user

Report or block j6s

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@j6s
j6s / merge_to_opus.rb
Last active May 4, 2017
merge_to_opus.rb
View 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:
View install_tool.rb
#!/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
#
View keybase.md

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:

View fixSteam.rb
#!/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]
View officeToPdf.sh
#!/bin/bash
libreoffice --headless --invisible --convert-to pdf $1
View batteryNotify.rb
#!/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
View lock.sh
#!/bin/sh
FILE=/tmp/screen_lock.png;
# take screenshot
scrot $FILE;
# pixelate
mogrify -scale 10% -scale 1000% $FILE
View iteration.js
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);
View pdfcompress.rb
#!/usr/bin/env ruby
require 'colorize'
HEADER = %Q{
pdfcompress: compresses a pdf using graphicsmagick.
Author: Johannes Hertenstein
Usage:
$pdfcompress.rb $input $output [$quality]
View gitstats.sh
#!/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";}'
You can’t perform that action at this time.