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
$ErrorActionPreference = "Stop" | |
$notificationTitle = "Notification: " + [DateTime]::Now.ToShortTimeString() | |
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null | |
$template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01) | |
#Convert to .NET type for XML manipuration | |
$toastXml = [xml] $template.GetXml() | |
$toastXml.GetElementsByTagName("text").AppendChild($toastXml.CreateTextNode($notificationTitle)) > $null |
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.Collections.Specialized; | |
using System.Globalization; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace AwsV4SignatureCalculator |
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
# This script adds a "Webclip" shortcut to your homescreen. | |
# The shortcut can be used to open a web page in full-screen mode, | |
# or to launch a custom URL (e.g. a third-party app). | |
# You'll be asked for a title, a URL, and an icon (from your camera roll) | |
import plistlib | |
import BaseHTTPServer | |
import webbrowser | |
import uuid | |
from io import BytesIO |
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 timeit | |
def while_var(): | |
count = 1000 | |
while(count > 0): | |
count -= 1 | |
def while_break(): | |
count = 1000 | |
while(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 os, os.path, sys, urllib2, requests | |
class PyPiError(Exception): | |
def __init__(self, value): | |
self.value = value | |
def __str__(self): | |
return repr(self.value) | |
def _chunk_report(bytes_so_far, chunk_size, total_size): | |
if (total_size != None): |
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 sys | |
import pickle | |
import console | |
# I moved 'dropboxlogin' into a sub folder so it doesn't clutter my main folder | |
sys.path += [os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib')] | |
import dropboxlogin # this code can be found here https://gist.github.com/4034526 | |
STATE_FILE = '.dropbox_state' |
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
# YOU NEED TO INSERT YOUR APP KEY AND SECRET BELOW! | |
# Go to dropbox.com/developers/apps to create an app. | |
app_key = 'YOUR_APP_KEY' | |
app_secret = 'YOUR_APP_SECRET' | |
# access_type can be 'app_folder' or 'dropbox', depending on | |
# how you registered your app. | |
access_type = 'app_folder' |