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 random | |
import re | |
import sys | |
from functools import lru_cache | |
@lru_cache() | |
def generate_die(sides): | |
return list(range(1, sides + 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
param( | |
[string] $target="templates", | |
[string] $platform="x64" | |
) | |
# 32-bit compile or 64-bit compile | |
if ($platform -eq "x64") { | |
Write-Host "Configuring for 64-bit..." | |
vcvarsall x86_amd64 |
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 MetaModel(type): | |
def _get_count(self): | |
# just do db lookup here | |
return 5 | |
count = property(_get_count) | |
class Model: | |
__metaclass__= MetaModel |
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
DATA_FILE = 'input.txt' | |
class BoxWrappingDimensions: | |
def __init__(self, length, width, height): | |
self.length = length | |
self.width = width | |
self.height = height | |
def _build_sides(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
: <<TRAMPOLINE | |
@echo off | |
"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" list runningvms>NUL | findstr /B \"LocalLinuxServer\" | |
IF %ERRORLEVEL% EQU 1 ( | |
C:\Users\BTaylor\Dropbox\Apps\HStart\hstart.exe /NOCONSOLE "C:\Program Files\Oracle\VirtualBox\VBoxHeadless.exe -s LocalLinuxServer" | |
start "" "C:\Program Files (x86)\Xming\Xming.exe" :0 -clipboard -multiwindow | |
) | |
set PATH=C:\cygwin\bin;%PATH% | |
bash "%~f0" "%*" > nul 2>&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
def RegisterHotkeys(self, Hotkeys): | |
for Hotkey in Hotkeys: | |
ID = wx.NewId() | |
self.RegisterHotKey(ID, Hotkey["Modifiers"], Hotkey["Key"]) | |
self.Bind(wx.EVT_HOTKEY, lambda Event: Hotkey["Function"](self.Controller), | |
id=ID) | |
self.EventIDs.append(ID) |
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 RegisterHotkeys(self, Hotkeys): | |
def RegisterHotkey(Hotkey): | |
ID = wx.NewId() | |
self.RegisterHotKey(ID, Hotkey["Modifiers"], Hotkey["Key"]) | |
self.Bind(wx.EVT_HOTKEY, lambda Event: Hotkey["Function"](self.Controller), | |
id=ID) | |
self.EventIDs.append(ID) | |
for Hotkey in Hotkeys: | |
RegisterHotkey(Hotkey) |
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
Name: | |
task | |
Program: | |
C:/Python27/pythonw.exe | |
Arguments: | |
G:/Projects/Current/CLTask/CLTask.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 smtplib, sys | |
from email.mime.text import MIMEText | |
Username = "me@email.com" | |
Password = "MyPassword" | |
SMTPServer = "smtp.gmail.com:587" | |
Sender = "me@email.com" | |
Recipient = "me@wunderlist.com" | |
Task = ' '.join(sys.argv[1:]) | |
Bucket = "Inbox" |
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
int main(int argv, char **args) { | |
EnumWindows(MyEnumProc, 0); | |
WunderlistWebCtrl = GetWindow(Wunderlist, GW_CHILD); | |
SetForegroundWindow(Wunderlist); | |
SetActiveWindow(Wunderlist); | |
SetFocus(WunderlistWebCtrl); | |
//Simulate a Ctrl+N keyboard shortcut | |
PostMessage(WunderlistWebCtrl, WM_KEYDOWN, VK_CONTROL, 0x001D0001); |
NewerOlder