Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
#!/usr/bin/env python | |
import sys | |
import time | |
import argparse | |
import os | |
import json | |
import socketserver | |
from http.server import BaseHTTPRequestHandler |
class PubSub(object): | |
""" | |
Very simple Pub/Sub pattern wrapper | |
using simplified Redis Pub/Sub functionality. | |
Usage (publisher):: | |
import redis | |
r = redis.Redis() |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
export PS1=$PS1_ADVANCED |
body { | |
font-family: 'Helvetica'; | |
} | |
.markdown-body { | |
font-family: 'Helvetica'; | |
} | |
.octotree_views { | |
font-family: 'FiraCode-retina'; | |
font-size: .75rem; | |
} |
tell application "Safari" | |
set total_tab_count to 0 | |
set number_of_windows to number of windows | |
repeat with x from 1 to number_of_windows | |
try | |
set current_windows_tab_count to number of tabs in window x | |
set total_tab_count to total_tab_count + current_windows_tab_count | |
on error error_message | |
log error_message | |
end try |
Lütfen https://github.com/AB2016-Ruby-on-Rails-101/Linkler sitesine gidiniz!
on run | |
tell application "Finder" | |
get bounds of window of desktop | |
set DesktopSize to bounds of window of desktop | |
set DesktopWidth to item 3 of DesktopSize | |
set DesktopHeight to item 4 of DesktopSize | |
end tell | |
tell application "App Store" | |
activate | |
set the bounds of the first window to {0, 0, DesktopWidth, DesktopHeight} |