Skip to content

Instantly share code, notes, and snippets.

View mbmccormick's full-sized avatar

Matt McCormick mbmccormick

View GitHub Profile
@mbmccormick
mbmccormick / gist:1872905
Created February 21, 2012 01:55
Remove application from Windows Phone Marketplace while another submission is being certified. Run this in a JavaScript console while viewing the Application Details page.
ApplicationDetails.onSubmitAction('1', '<your application id>', '<your application instance id>', '1', 'False');
@mbmccormick
mbmccormick / gist:1560472
Created January 4, 2012 15:15
Import Legacy mbox Files into Gmail
python imap_upload.py --gmail --box Imported "C:\Users\%USERNAME%\AppData\Roaming\Thunderbird\Profiles\XXXXXXXX.default\Mail\pop-server.wi.rr.com\Inbox"
@mbmccormick
mbmccormick / gist:1396105
Created November 26, 2011 18:32
Add Progress Bar to System Tray
ProgressIndicator progressIndicator = new ProgressIndicator();
SystemTray.ProgressIndicator = progressIndicator;
progressIndicator.IsVisible = true;
progressIndicator.IsIndeterminate = true;
@mbmccormick
mbmccormick / gist:1396098
Created November 26, 2011 18:29
Adding Turnstyle transitions to Windows Phone applications
<toolkit:TransitionService.NavigationInTransition>
<toolkit:NavigationInTransition>
<toolkit:NavigationInTransition.Backward>
<toolkit:TurnstileTransition Mode="BackwardIn"/>
</toolkit:NavigationInTransition.Backward>
<toolkit:NavigationInTransition.Forward>
<toolkit:TurnstileTransition Mode="ForwardIn"/>
</toolkit:NavigationInTransition.Forward>
</toolkit:NavigationInTransition>
</toolkit:TransitionService.NavigationInTransition>
@mbmccormick
mbmccormick / gist:1345367
Created November 7, 2011 16:05
Gist caching and download logic.
<?php
// extract gist id from url
$gist = $_GET[id];
// create cache directory
if (file_exists("gists/") == false)
mkdir("gists", 0700);
// check if we have need to update our local copy of the gist
@mbmccormick
mbmccormick / gist:1345316
Created November 7, 2011 15:45
Handle browser's back button, dynamically load content, transition to replace content
$(window).bind("popstate", function() {
$("body").css("cursor", "progress");
$(".main").after("<section class='left'></section>");
$(".left").load(location.pathname + " .main>*", function() {
if ($(".left h1").text().length > 0)
document.title = "Matt McCormick - " + $(".left h1").text();
else
document.title = "Matt McCormick";
@mbmccormick
mbmccormick / gist:1345302
Created November 7, 2011 15:40
Override navigation links, dynamically load content, transition to replace content
$("aside a.logo, nav ul li a").live("click", function(e) {
if ((e.which == 1 && !e.metaKey && !e.shiftKey) == false)
return true;
history.pushState("", "", this.href);
$("body").css("cursor", "progress");
$(".main").after("<section class='right'></section>");
@mbmccormick
mbmccormick / gist:1335716
Created November 3, 2011 03:40
Update Weather script to support "natural language" replies, specify temperature format
robot.respond /weather(?: me|for|in)?\s(.*)/, (msg) ->
query msg, (body, err) ->
return msg.send err if err
city = body.getElementsByTagName("city")[0]
return msg.send "Sorry, but you didn't specify a location." if not city or not city.getAttribute
city = city.getAttribute("data")
currentCondition = body.getElementsByTagName("current_conditions")[0].getAttribute("data")
conditions = body.getElementsByTagName("current_conditions")[0].getElementsByTagName("condition")[0].getAttribute("data")
@mbmccormick
mbmccormick / gist:1273156
Created October 9, 2011 01:22
Install Hamachi VPN on the PogoPlug USB Device (Part 8)
cd /etc/init.d/
wget http://mbmccormick.com/files/pogoplug/hamachi.sh
chmod 777 hamachi.sh
echo "/etc/init.d/hamachi.sh start" >> /etc/init.d/rcS
@mbmccormick
mbmccormick / gist:1273155
Created October 9, 2011 01:21
Install Hamachi VPN on the PogoPlug USB Device (Part 7)
echo "KeepAlive 20" >> /root/.hamachi/config