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
<?php | |
/*First of all I'm going to DEFINE a few constants because it makes more sense | |
to use DEFINE for variables that do not change during the execution of the code.*/ | |
//Max. size of uploaded files in MB | |
define('F_UPLOAD_MAX_SIZE_MB', 12); | |
//Directory to save uploaded files in | |
define('F_UPLOAD_DIR', './uploads'); | |
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 bottle import app, route | |
@route("/") | |
@route("/<name>") | |
def index(name=None): | |
out=[] | |
if name is not None: | |
out.append("%s says "%(name,)) | |
out.append("Hello, World") | |
return out |
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/python | |
import itertools | |
address="fe80::224:8cff:fe09:98dd" | |
#verbose | |
addressLeft, addressRight=[x.split(":") for x in address.split("::")] | |
addressZeros=["0" for i in range(0, 8-(len(addressLeft)+len(addressRight)))] | |
print itertools.chain(addressLeft, addressZeros, addressRight) |
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 re | |
with open("infile.txt", "r") as fp: | |
queue="" | |
match=r"[?!.]+\s+" | |
for rawLine in fp: | |
rawLine=" ".join((queue, rawLine)) | |
queue="" | |
lines=rawLine.split(match) | |
if re.search(match+"$", rawLine): |
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
for URL in url1 url2 url3; | |
do | |
curl -sLI -w "%{http_code} %{url_effective}\\n" "$URL" -o /dev/null |tee -a output.txt; | |
done; |