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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Diagnostics; | |
namespace MediatorDemo | |
{ | |
class Dispatcher | |
{ |
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
# pyCrypto.AES file encoding example based on | |
# Eli Bendersky post (http://eli.thegreenplace.net/2010/06/25/aes-encryption-of-files-in-python-with-pycrypto/) | |
from Crypto.Cipher import AES | |
from Crypto import Random | |
import os | |
import random | |
import struct | |
import hashlib |
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
# Dynamic configuration file inclusion example. | |
# This script is intended for demo purposes and home usage only. | |
# There are intentionally no any security checks. | |
import imp | |
import sys | |
if len(sys.argv) < 2: | |
print "Specify a configuration file to include" | |
exit(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
import feedparser | |
from time import mktime | |
from datetime import datetime | |
def format_datetime(struct_time): | |
return datetime.fromtimestamp(mktime(struct_time)) | |
def read_gist_feed(github_user): |
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
# Python gzip demo: create and unpack archive | |
import os | |
import random | |
import string | |
import glob | |
import tarfile | |
import shutil | |
import filecmp |
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
@echo off &python -x %0 %* &goto :eof | |
print("Hello Python!") |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Diagnostics; | |
namespace Interpolation | |
{ | |
/// <summary> | |
/// Spline interpolation class. |
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 os | |
import random | |
import shutil | |
def copydir(source, dest, indent = 0): | |
"""Copy a directory structure overwriting existing files""" | |
for root, dirs, files in os.walk(source): | |
if not os.path.isdir(root): | |
os.makedirs(root) |
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
PID_FILE = 'pid.txt' |
OlderNewer