Skip to content

Instantly share code, notes, and snippets.

View mnn's full-sized avatar

monnef mnn

View GitHub Profile
import scala.runtime.ScalaRunTime.stringOf
import scala.collection.JavaConverters._
// stuff for verifying results, skip to case defs (comment -- 1 --)
def doVerify[A](name: String, origRes: A, myRes: A) {
val equals = origRes match {
case a: Array[_] => a.sameElements(myRes.asInstanceOf[Array[_]])
case _ => origRes.equals(myRes)
}
if (equals) println(s"Case '$name' fine: ${stringOf(myRes)}")
@mnn
mnn / popupAdBlocker.js
Last active August 29, 2015 13:57
Pop-up Ad Blocker for ads placed in state of "being almost inactive" on 000webhost.com (ads by Hosting24.com)
/*
Pop-up Ad Blocker for ads placed in state of "being almost inactive" on 000webhost.com (ads by Hosting24.com)
made by monnef
If you use this script you can still tell when you should log-in to prevent freezing your account.
(If you use blocking in .htaccess you cannot really tell, when it's active.)
The responsible script -> http://stats.hosting24.com/count.php
*/
function markAdBlocked(str){
@mnn
mnn / avisynth - fullscreen
Last active August 29, 2015 13:57
adds bars to bottom and top so the resulting stream covers whole screen (de_w and de_h parameters)
de_w=1920.0
de_h=1080.0
a=de_w/de_h
my_w=Width()
my_h=Height()
p_w=0
p_h=(-my_h+(my_w/a))/2
AddBorders(round(p_w), round(p_h), round(p_w), round(p_h),$000000)
#Subtitle(string(p_h)+"x")
http://www.engadget.com/
http://www.theverge.com/
http://www.zdnet.com/
http://www.neowin.net/
http://www.anandtech.com/
http://arstechnica.com/
http://theverge.com/
http://www.osnews.com/
http://www.cnews.cz
http://cdr.cz
Α α Alpha a al-fa
Β β Beta b be-ta
Γ γ Gamma g ga-ma
Δ δ Delta d del-ta
Ε ε Epsilon e ep-si-lon
Ζ ζ Zeta z ze-ta
Η η Eta h eh-ta
Θ θ Theta th te-ta
Ι ι Iota i io-ta
Κ κ Kappa k ka-pa
current="$(readlink -f $(dirname "$0"))"
@mnn
mnn / prepare_wallpaper.sh
Created October 1, 2013 15:32
Converts wallpaper picture to 1920x1080 dual monitor setup - left monitor filled with gray, right with input image. Uses ImageMagick.
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "$0 <input_file> <output_file>"
exit 1
fi
convert "$1" -resize 1920x1080 -background "#222222" -gravity east -extent 3840x1080 "$2"