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 | |
usage() { | |
echo "Version 0.15.1, GNU GPLv3 | |
*** WARNING: ALPHA VERSION CODE!!! THIS PROGRAM EATS HAMSTERS! *** | |
This program takes an .srt, .txt, .pdf, or .epub file, translates it, and merges both translations | |
into an .ssa or .txt file in a parallel manner, allowing both subtitles to be viewed at the same time. |
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
1 | |
00:03:12,440 --> 00:03:14,769 | |
Salut. J'ai rendez-vous avec M. Ullman. | |
2 | |
00:03:14,980 --> 00:03:16,939 | |
Mon nom est Jack Torrance. | |
3 | |
00:03:17,110 --> 00:03:19,649 |
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 | |
# | |
# This program takes an .srt file, translates it, and merges both translations into a .ass file with the user's selected | |
# language on top of the screen and the other language at the bottom. | |
# | |
# Usage: ./transmerge.sh [source language] [target language] [language on top (en|fri|...)] [source .srt] [target .ass (optional)] | |
# | |
# ex., $ ./transmerge.sh en fr en movie.srt | |
# |
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
/* | |
Key/Touch/Secondary Button Stimulator | |
Compile with: | |
gcc -Wall -O2 mouse.c -o mouse -lX11 -lXtst -lXext | |
SendKey function courtesy of: | |
https://bharathisubramanian.wordpress.com/2010/03/14/x11-fake-key-event-generation-using-xtest-ext/ |
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
/* | |
Config file: /home/pi/.config/dunst/dunstrc | |
gcc -o notify `pkg-config --cflags --libs libnotify` notify.c | |
*/ | |
#include <libnotify/notify.h> | |
int main(int argc, char **argv) { |
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
/* | |
g++ -Wall -O2 editfile.cpp -o editfile | |
*/ | |
#include <fcntl.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <sys/sendfile.h> | |
#include <sys/stat.h> |
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
/* | |
Compile with: | |
gcc -O3 -Wall youtube.c -o youtube -lX11 | |
*/ | |
#include<X11/Xlib.h> | |
#include<unistd.h> | |
#include<stdio.h> |
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 | |
URL="https://weather.gc.ca/city/pages/on-77_metric_e.html" | |
A='center">' | |
B='</p>' | |
C='>' | |
D='°' | |
echo $(wget -q -O- "$URL" | awk -v v1="$A" -v v2="$B" -v v3="$C" -v v4="$D" '$0 ~ v1 ".*" v2 {sub(v2 ".*", ""); sub(".*" v1, ""); print $0; next;} $0 ~ v3 ".*" v4 {sub(v4 ".*", ""); sub(".*" v3, ""); print $0 "°C"; exit}') |
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
// Compile with: | |
// | |
// g++ -std=c++11 -O2 -Wall bar.cpp -o bar -lasound -lpthread | |
// | |
#include<alsa/asoundlib.h> // install libasound2-dev | |
#include<fstream> | |
#include<iostream> | |
#include<string> | |
#include<chrono> |
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
// This code comes from: | |
// https://www.geeksforgeeks.org/b-tree-set-1-insert-2/ | |
// | |
// It has been altered to support a string index and two integer values. | |
// | |
#include<iostream> | |
#include<string> | |
using namespace std; |
NewerOlder