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
IFS=$'\n' | |
BASE="http://www.wwii-photos-maps.com/kievaerialscans/GX3938SG%282%29-260943/" | |
index=1 | |
for x in `curl "$BASE/index.html" 2>/dev/null | grep -io 'slides/.*html'`; do | |
for img in $(curl -L `echo "${BASE}${x}" | sed 's/ /%20/'` 2>/dev/null | grep -ioP 'src=".*?jpg"' | grep -v thumbs | sed -r "s/src=\"(.*)\"/\1/g"); do | |
curl "$BASE/slides/$img" > "$index-$img" | |
index=$((index+1)) | |
done | |
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 | |
if ! nmcli con status id HomeVPN &>/dev/null; then | |
nmcli con up id HomeVPN | |
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
from StringIO import StringIO | |
import re | |
import itertools | |
s = 'text1 text2 /* asdasd */ text3 /* /*asdasd */ text4' | |
BLOCK = 6 # even number! | |
OPEN = 1 | |
CLOSE = 2 |
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 sys | |
N = int(sys.argv[1]) | |
print (lambda n,f: f(n-1, f) + f(n-2, f) if n>2 else 1) \ | |
(N, lambda n,f: f(n-1,f)+f(n-2,f) if n>2 else 1 if n>2 else 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
*.pyc |
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
class Singleton(type): | |
def __init__(cls, name, bases, dic): | |
super(Singleton,cls).__init__(name,bases,dic) | |
cls.instance = None | |
def __call__(cls,*args,**kw): | |
if cls.instance is None: | |
cls.instance=super(Singleton,cls).__call__(*args,**kw) | |
return cls.instance |
NewerOlder