This file contains hidden or 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
| public static void wol(String mac) throws IOException { | |
| int[] hex = Pattern.compile("[:-]").splitAsStream(mac).mapToInt(f -> Integer.parseInt(f, 16)).toArray(); | |
| byte[] bytes = new byte[6 + 6 * 16]; | |
| for (int i = 0; i < 6; i++) { | |
| bytes[i] = (byte) 0xFF; | |
| } | |
| for (int i = 0; i < 16; i++) { | |
| for (int m = 0; m < hex.length; m++) { |
This file contains hidden or 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 static java.nio.charset.StandardCharsets.*; | |
| import java.io.IOException; | |
| import java.net.DatagramPacket; | |
| import java.net.InetAddress; | |
| import java.net.MulticastSocket; | |
| import java.net.SocketTimeoutException; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| import java.util.function.Consumer; |
This file contains hidden or 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 static org.junit.jupiter.api.Assertions.*; | |
| import java.io.File; | |
| import java.util.LinkedList; | |
| import java.util.List; | |
| import java.util.Set; | |
| import java.util.Stack; | |
| import picocli.CommandLine; | |
| import picocli.CommandLine.IParameterConsumer; |
This file contains hidden or 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 filebot -script | |
| @Grab(group='com.googlecode.lanterna', module='lanterna', version='3.0.0-beta3') | |
| import com.googlecode.lanterna.* | |
| import com.googlecode.lanterna.screen.* | |
| import com.googlecode.lanterna.terminal.* | |
| import com.googlecode.lanterna.gui2.* | |
| import com.googlecode.lanterna.gui2.table.* | |
| import com.googlecode.lanterna.gui2.dialogs.* |
This file contains hidden or 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
| def languages = _args.lang.split(/\W/) as List | |
| // select input videos | |
| def videoFiles = args.getFiles{ it.isVideo() } | |
| // fetch missing subtitles | |
| def subtitleFiles = languages.findResults{ | |
| getMissingSubtitles(lang: it, file: videoFiles, output: 'srt', encoding: 'UTF-8') | |
| }.flatten() |