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
#!/usr/bin/python | |
# Challenge: http://www.reddit.com/r/dailyprogrammer/comments/xx97s/882012_challenge_86_intermediate_weekday/ | |
# Solution: http://www.reddit.com/r/dailyprogrammer/comments/xx97s/882012_challenge_86_intermediate_weekday/c5qgu1k | |
# Run code online: http://ideone.com/HIyf7 | |
import sys | |
# this example assumes proper dates are entered (there are no safety checks performed) | |
if len(sys.argv) == 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
#!/usr/bin/python | |
# Challenge: http://www.reddit.com/r/dailyprogrammer/comments/xxbbo/882012_challenge_86_easy_runlength_encoding/ | |
# Solution: http://www.reddit.com/r/dailyprogrammer/comments/xxbbo/882012_challenge_86_easy_runlength_encoding/c5qf7af | |
# Run code online: http://ideone.com/DwxRr | |
import sys | |
import re | |
if len(sys.argv) == 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
# enable guest additions for virtualbox | |
# in settings > shared folders, add a shared-folder | |
# make folder to mount windows/mac shared-folder to | |
mkdir windows-share-folder | |
# where 'Shared' below matches the name from the settings dialog | |
sudo mount -t vboxsf Shared ~/windows-share-folder | |
# testing old IE in Ubuntu: | |
sudo add-apt-repository ppa:ubuntu-wine/ppa | |
sudo apt-get update |
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
function check_site() | |
{ | |
local stored_hash='' | |
local changed=false | |
while sleep 60; do | |
# beep a bunch of times: | |
if $changed; then | |
if [[ "$(command -v osascript)" ]]; then | |
osascript -e "beep 5" | |
elif [[ "$(command -v tput)" ]]; then |
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
alias npr="osascript -e 'tell application \"iTunes\" to activate' \ | |
-e 'tell application \"iTunes\" to play playlist \"NPR\"'" | |
alias di="osascript -e 'tell application \"iTunes\" to activate' \ | |
-e 'tell application \"iTunes\" to play playlist \"DI.fm\"'" |
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 accepts an email address to use to retrieve an Amazon wishlist | |
# for, and an optional branch-ID for the Chicago Public Library system. The | |
# script parses the wishlist and finds the books that are available for | |
# *CHECK OUT* (unavailable books, in-transit, on hold, etc. are ignored). | |
require 'net/https' | |
require "open-uri" | |
require 'uri' | |
require 'zlib' |
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
#!/bin/sh | |
# generates an empty .project file with just the name of the directory | |
# being used as the project name | |
# USAGE: | |
if [ "$1" = "-h" -o "$1" = "--help" ]; then | |
echo; echo "Usage: $0 [options]" | |
echo; echo "== Options" | |
echo; echo -e "Pass the string \"sub\" to generate empty .project files for \ |
NewerOlder