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
myproject | |
- directoryX | |
- beautifulClass.py | |
- directoryY | |
- scriptThatNeedsBeautifulClass.py |
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 | |
(s,c,m,w,k,z,b)=("Easterhegg",0,int(sys.argv[1]),sys.stdout.write,0,lambda p:s[p%len(s)],[]) | |
for v in [g for g in list(bin(0x471000)[2:].zfill(30)) for _ in range(m*2)]: | |
if not k%(5*m*2):b+=["\n"];w(''.join(b*m));b=[] | |
if int(v):b+=[" "] | |
else:b+=[z(c)];c+=1 | |
k+=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
. | |
\_ server.py | |
\_ track | |
\_ __init__.py | |
\_ history.py (class history) | |
\_ downloader.py (class downloader) | |
server.py: |
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
try: | |
im = Image.open( infile ) | |
except IOError: | |
print "Cant load", infile | |
sys.exit(1) | |
curW, curH = size = im.size |
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
def mapRange( val, min1, max1, min2, max2 ): | |
return (val-min1)/(max1-min1) * (max2-min2) + min2 | |
def toGrayscale( rgb, steps = 3.0 ): | |
r, g, b = rgb | |
value = float( r + g + b ) / 3.0 | |
value = mapRange( value, 0.0, 255.0, 0.0, steps ) |
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
Mode | |
The mode of an image defines the type and depth of a pixel in the image. The current | |
release supports the following standard modes: | |
1 (1-bit pixels, black and white, stored as 8-bit pixels) | |
• | |
L (8-bit pixels, black and white) | |
• | |
P (8-bit pixels, mapped to any other mode using a colour palette) | |
• | |
RGB (3x8-bit pixels, true colour) |
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
works: | |
{'background': 255, 'extension': ('NETSCAPE2.0', 795), 'version': 'GIF89a', 'transparency': 255, 'duration': 70, 'loop': 0} | |
{'background': 0, 'extension': ('NETSCAPE2.0', 75), 'version': 'GIF89a', 'transparency': 14, 'duration': 70, 'loop': 0} | |
doesnt work: | |
{'background': 0, 'extension': ('NETSCAPE2.0', 123), 'version': 'GIF89a', 'transparency': 31, 'duration': 1500, 'loop': 0} |
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
awesome.log: | |
------------ | |
g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting. | |
awesome.err: | |
------------ | |
rxvt: perl extension 'clipboard' not found in perl library search path | |
rxvt: perl extension 'clipboard' not found in perl library search path |
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 requests | |
url = 'https://webrelais.bckspc.de/relais/3' | |
if requests.get(url).json()['response']: | |
requests.delete(url) | |
else: | |
requests.post(url) |
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 requests | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/") | |
def toggle(): | |
url = 'https://webrelais.bckspc.de/relais/3' | |
if requests.get(url).json()['response']: | |
requests.delete(url) | |
else: |
OlderNewer