Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlackColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw | |
LjIwMDAwMDAxNzkgMC4yMzkyMTU3MDE4IDAuMjc0NTA5ODE3NAAQAoAC0hAREhNaJGNs | |
YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp |
#!/bin/sh | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' |
#!/usr/bin/env ruby | |
# SearchLink 2.1.0 by Brett Terpstra 2014 (http://brettterpstra.com) | |
# Free to use and modify, please maintain attribution | |
require 'net/https' | |
require 'shellwords' | |
require 'yaml' | |
require 'rubygems' | |
require 'json' | |
require 'cgi' |
(* /// | |
PROPERTIES | |
/// *) | |
--Formatting | |
(* DO NOT CHANGE *) | |
property line_feed : (ASCII character 10) | |
property md_line_feed : (ASCII character 32) & (ASCII character 32) & (ASCII character 10) | |
property as_delims : AppleScript's text item delimiters |
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): |
# Banner-style (default) | |
from Foundation import NSUserNotification, NSUserNotificationCenter | |
def notify(title, subtitle, text): | |
notification = NSUserNotification.alloc().init() | |
notification.setTitle_(str(title)) | |
notification.setSubtitle_(str(subtitle)) | |
notification.setInformativeText_(str(text)) | |
notification.setSoundName_("NSUserNotificationDefaultSoundName") | |
NSUserNotificationCenter.defaultUserNotificationCenter().scheduleNotification_(notification) |
(* ACCEPT/REJECT CRITICMARKUP CHANGES | |
--Stephen Margheim | |
--23 July 2013 | |
--open source | |
--VERSION 2.0 | |
I rewrote the entire script from the ground up. | |
Changes: | |
--Script moves sentence by sentence and alters text each time, so that Contextual views become less and less cluttered. |
display dialog "Get Link of selected note or choose other note?" buttons {"Get Selected", "Choose Other"} default button {"Get Selected"} | |
--Get Markdown formatted info from Selected Note | |
if result = {button returned:"Get Selected"} then | |
tell application "Evernote" | |
set Evernote_Selection to selection | |
if Evernote_Selection is {} then display dialog "Please select a note." | |
set noteLink to "" | |
repeat with i from 1 to the count of Evernote_Selection |
display dialog "Get Link of selected note or choose other note?" buttons {"Get Selected", "Choose Other"} default button {"Get Selected"} | |
--Get Markdown formatted info from Selected Note | |
if result = {button returned:"Get Selected"} then | |
tell application "Evernote" | |
set Evernote_Selection to selection | |
if Evernote_Selection is {} then display dialog "Please select a note." | |
set noteLink to "" | |
repeat with i from 1 to the count of Evernote_Selection |