Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
key_move_song_up = 'K' | |
key_move_song_down = 'J' | |
key_next_found_position = 'n' | |
key_prev_found_position = 'N' | |
key_prev_column = 260 'h' | |
key_next_column = 261 'l' | |
key_lyrics = '.' | |
key_home = 262 'g' | |
key_end = 360 'G' |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
@echo off | |
setlocal enabledelayedexpansion | |
if {%1}=={} ( | |
echo Usage: %~nx0 [vhd] [letter] | |
exit /b 1 | |
) | |
set vhdPath=%~dpnx1 | |
set driveLetter=%2 |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Upload your files</title> | |
</head> | |
<body> | |
<form enctype="multipart/form-data" action="upload.php" method="POST"> | |
<p>Upload your file</p> | |
<input type="file" name="uploaded_file"></input><br /> | |
<input type="submit" value="Upload"></input> |
Dashing widget to display a random cute picture from http://reddit.com/r/aww
The display of the widget is heavily based on the Image widget, however it does not prepend the src with 'assets' which allows for external images.
You can set a placeholder image in the event that reddit is down, or otherwise unresponse. This is set at the top of random_aww.rb as follows:
/* | |
LUFA Library | |
Copyright (C) Dean Camera, 2012. | |
dean [at] fourwalledcubicle [dot] com | |
www.lufa-lib.org | |
*/ | |
/* | |
Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"