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 Tkinter import * | |
import tkFileDialog | |
main = Tk() | |
main.title("Notpad") | |
main.minsize(width=500,height=400) | |
text = Text(main) | |
text.pack(expand=YES, fill=BOTH) |
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
convert -colorspace RGB -density 300 -quality 80 file.pdf file.tif |
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 os | |
#TODO: What happens if script is imported as module? | |
WORKING_DIRECTORY = os.path.dirname(os.path.abspath(__file__)) | |
from Tkinter import * | |
import tkFileDialog |
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
virtualenv --no-site-packages . | |
source bin/activate | |
bin/pip install Django psycopg2 django-sentry | |
bin/pip freeze > requirements.txt | |
bin/django-admin.py startproject mysite | |
cat >.gitignore <<EOF | |
bin/ | |
include/ | |
lib/ | |
EOF |
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
-webkit-background-clip: text; |
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
dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend |
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
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" |
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 ctypes | |
import os | |
class XScreenSaverInfo( ctypes.Structure): | |
""" typedef struct { ... } XScreenSaverInfo; """ | |
_fields_ = [('window', ctypes.c_ulong), # screen saver window | |
('state', ctypes.c_int), # off,on,disabled | |
('kind', ctypes.c_int), # blanked,internal,external | |
('since', ctypes.c_ulong), # milliseconds | |
('idle', ctypes.c_ulong), # milliseconds |
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
# myservice.py | |
# simple python-dbus service that exposes 1 method called hello() | |
import gtk | |
import dbus | |
import dbus.service | |
from dbus.mainloop.glib import DBusGMainLoop | |
class MyDBUSService(dbus.service.Object): | |
def __init__(self): |
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 python | |
from ctypes import Structure, windll, c_uint, sizeof, byref | |
import time | |
class LASTINPUTINFO(Structure): | |
_fields_ = [ | |
('cbSize', c_uint), | |
('dwTime', c_uint), | |
] |
OlderNewer