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 ruby | |
# Convert images recursively to heic | |
# Prereq.: sudo apt install libheif-examples libimage-exiftool-perl | |
require 'fileutils' | |
CONVERTERS = { | |
'heif-enc' => '-q 50 -o "%s" "%s"' | |
} |
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 | |
DIRS="${SYNC_DIRS:-Addons Documents}" | |
for dir in $DIRS | |
do | |
echo "*** synchronize $dir..." | |
rsync -a --delete --update --progress /shares/vol1/$dir/ /shares/vol2/$dir/ | |
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
#!/usr/bin/env ruby | |
# Convert images recursively to webp | |
require 'fileutils' | |
CONVERTERS = { | |
'cwebp' => '-q 80 "%s" -m 6 -o "%s"', | |
'magick convert' => '-quality 80 -define webp:method=6 "%s" "%s"' | |
} |
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
DIACRITICS = [*0x1DC0..0x1DFF, *0x0300..0x036F, *0xFE20..0xFE2F].pack('U*') | |
def removeaccents(str) | |
str | |
.unicode_normalize(:nfd) | |
.tr(DIACRITICS, '') | |
.unicode_normalize(:nfc) | |
end |
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
import java.awt.*; | |
import java.awt.event.*; | |
public class Caffeine { | |
public static void main(String[] args) throws Exception { | |
Robot robot = new Robot(); | |
while (true) { | |
try { | |
int xMove = Math.random() < 0.5 ? 1 : -1; | |
int yMove = Math.random() < 0.5 ? 1 : -1; |
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 ruby | |
# Convenience methods for ffmpeg | |
# Character encoding of subtitle | |
SUB_ENCODING = 'ISO-8859-2' | |
# Subtitle language | |
SUB_LANG = 'hun' |
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
' Run with: wscript.exe caffeine.vbs | |
Set WshShell = WScript.CreateObject("WScript.Shell") | |
WScript.Echo "Caffeine started" | |
While Hour(Now) < 18 | |
WshShell.SendKeys "+{F16}" | |
WScript.Sleep 50000 | |
Wend | |
WshShell.Run "shutdown.exe /s /t 10 /f", 0, True |
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 | |
for i in {1..1000} | |
do | |
echo 'tell application "System Events" to key code 113 using shift down' | osascript | |
echo "$i / 1000" | |
sleep 30 | |
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
#!/bin/bash | |
exit_with_error() { | |
if [ -n "$1" ]; then | |
echo "ERROR: $1" | |
else | |
echo "ERROR: could not convert file" | |
fi | |
exit 1 | |
} |
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 ruby | |
# Sitemap URL Checker | |
# | |
# MIT License | |
# | |
# Copyright (c) 2017 Gabor Bata | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal |
NewerOlder