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 perl | |
# Download a shelf of playlists from Youtube | |
# using wget, perl and youtube-dl. | |
# After using it, you'll find folders with the playlists' | |
# names, and each has a file named '.get'. Issue `. .get` | |
# in your terminal to start downloading the playlist. | |
# You can run `for i in *; do cd "$i"; . .get; cd ..; done` | |
# to get them all after this script. | |
# License: CC0 |
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 | |
# Download Linux Voice magazines and optimize them for screens | |
# which makes them less than half in size | |
get_issue() { | |
temp_file=Linux-Voice-Issue-0$1_.pdf | |
final_file=Linux-Voice-Issue-0$1.pdf | |
[ -e $final_file ] && return | |
wget -qc --show-progress -O $temp_file \ | |
https://www.linuxvoice.com/issues/0$1/Linux-Voice-Issue-0$1.pdf && | |
ps2pdf -dSETTING=/ebook $temp_file $final_file && |
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 | |
## Introduction | |
# This script calculates the frequencies of letters and letter combinations (monograms, bigrams, trigrams) in a given text. The frequency is given as the percentage of occurrences. | |
# This script is language- and script-agnostic; it should work with any script whatsoever (it's tested with Arabic). It's written in POSIX sh, and uses Unix tools, so it should work on most OSes. Please note it's case-sensitive. | |
# This script is licensed under the terms of CC0. Attribution is really appreciated but not required. | |
# Contact the author at noureddin@protonmail.com or noureddin95@gmail.com | |
# defining a function that changes the numbered output of `uniq -c | sort -nr` to percentage | |
numbered2percent() |
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/python3 | |
# translate dvorak to qwetry and vice versa | |
# thank you, tr; you're useless to me! | |
# usage: | |
# run it, and input a line of dvorak-encoded text, then press enter to get the qwerty-decoded one | |
# run it with any argument, and input a line of qwerty, then press enter to get dvorak | |
h = {} | |
h[']'] = '/'; 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/bash | |
if [ -z "$1" ]; then | |
wget -qc --show-progress http://dl.fullcirclemagazine.org/issue{117..0}_en.pdf 2>/dev/null | |
else | |
wget -qc --show-progress http://dl.fullcirclemagazine.org/issue${1}_en.pdf | |
fi |
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 | |
# edit a gist file contents: https://developer.github.com/v3/gists/#edit-a-gist | |
# based on https://gist.github.com/noureddin/93d6182acdd1dcdf880daee1b97af05f | |
GITHUB_USERNAME=noureddin # change this to your github username | |
if [ $# -lt 2 ]; then | |
printf "Usage: %s id filename [gistname]\n" $(basename "$0") >&2 | |
exit 1 # exit with error | |
fi |
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
\documentclass{report} | |
\usepackage{caption} | |
\usepackage{polyglossia} | |
\setmainlanguage{arabic} | |
\newfontfamily\arabicfont[Script=Arabic,Scale=1]{KacstOne} | |
% https://tex.stackexchange.com/questions/350777/side-by-side-figures-are-reversed-in-lof-bidi-xetex | |
\newcommand{\dblimg} | |
[7][ht]{{% | |
\stepcounter{figure} |
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 | |
GITHUB_USERNAME=noureddin # change this to your github username | |
# or see https://gist.github.com/s-leroux/7cb7424d33ba3753e907cc2553bcd1ba | |
if [ "$1" == "" ]; then | |
printf "Usage: %s [--public] filename [gistname]\n" $(basename "$0") >&2 | |
exit 1 # exit with error | |
fi |
NewerOlder