Skip to content

Instantly share code, notes, and snippets.

type GeneralCollaboratorType = "all" | "none";
type SpecificCollaboratorType = "inclusion" | "exclusion";
type NonAuthenticatedCollaborator = {
type: "anonymous";
};
type CollaboratorList = {
type: SpecificCollaboratorType,
company_ids: number[]
@urbushey
urbushey / line80.py
Created April 20, 2013 21:28
PEP-8 recommends 80 character-lines for Python code.
# 80 ---->
@urbushey
urbushey / switch_profile.py
Created October 9, 2012 22:35
Swap color themes (between Solarized Light and Solarized Dark) in Sublime Text 2 based on the time of day. Meant to be scheduled by the Windows Task Scheduler or cron.
from os import path, environ
import datetime
import json
import sys
appdata = environ['APPDATA']
sublime_path = 'Sublime Text 2'
settings_path = 'Packages\User\Preferences.sublime-settings'
day_profile = 'Packages/Color Scheme - Default/Solarized (Light).tmTheme'
night_profile = 'Packages/Color Scheme - Default/Solarized (Dark).tmTheme'
@urbushey
urbushey / copytoclipboard.iss
Created January 31, 2012 02:51
INNO Setup .iss script to add several keys to the registry
[Registry]
Root: HKCR; Subkey: "giffile\shell\Copy image to clipboard\command"; Flags: uninsdeletekey; ValueType: string; ValueData: """{app}\copytoclipboard.exe"" ""%1"""
Root: HKCR; Subkey: "jpegfile\shell\Copy image to clipboard\command"; Flags: uninsdeletekey; ValueType: string; ValueData: """{app}\copytoclipboard.exe"" ""%1"""
Root: HKCR; Subkey: "Paint.Picture\shell\Copy image to clipboard\command"; Flags: uninsdeletekey; ValueType: string; ValueData: """{app}\copytoclipboard.exe"" ""%1"""
Root: HKCR; Subkey: "pngfile\shell\Copy image to clipboard\command"; Flags: uninsdeletekey; ValueType: string; ValueData: """{app}\copytoclipboard.exe"" ""%1"""
Root: HKCR; Subkey: "TIFImage.Document\shell\Copy image to clipboard\command"; Flags: uninsdeletekey; ValueType: string; ValueData: """{app}\copytoclipboard.exe"" ""%1"""
@urbushey
urbushey / copytoclipboard.py
Created January 30, 2012 03:59
Script to copy an image to clipboard
import win32api, sys
import Image
import win32clipboard
from cStringIO import StringIO
def send_to_clipboard(clip_type, data):
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardData(clip_type, data)
win32clipboard.CloseClipboard()