Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| # sm apidoc | |
| A command has returned error code '(1)' without being handled. | |
| +# source file # function() | |
| ================================================================================================================================================================================================================ | |
| vi +15 core/internal/shell/extensions/execution/functions # __sm.extension.actions.type | |
| vi +149 core/sm/shell/core/initialize # /opt/sm/core/sm/shell/core/initialize | |
| vi +29 bin/sm # /opt/sm/bin/sm | |
| ================================================================================================================================================================================================================ |
| # sm set help | |
| __sm.actions.call:6: command not found: sets_help | |
| A command has returned error code '(127)' without being handled. | |
| +# source file # function() | |
| ================================================================================================================================================================================================================ | |
| vi +454 /opt/sm/core/sm/shell/log/functions # __sm.actions.call | |
| vi +178 /opt/sm/core/internal/shell/extensions/execution/functions # __sm.extension.run | |
| vi +150 /opt/sm/core/sm/shell/core/initialize # /opt/sm/core/sm/shell/core/initialize |
| # sm set install irc | |
| # sm znc help | |
| /opt/sm/sets/active/irc/znc/bin/help:3: command not found: description | |
| A command has returned error code '(127)' without being handled. | |
| +# source file # function() | |
| ================================================================================================================================================================================================================ | |
| vi +3 bin/help # /opt/sm/sets/active/irc/znc/bin/help |
| # sm --trace=all --call=api/extensions/completion/extension_action_completion -- sm | |
| +/opt/sm/core/sm/shell/core/cli:124 /opt/sm/core/sm/shell/core/cli():124 > debug_flags=-search | |
| +/opt/sm/core/sm/shell/core/cli:125 /opt/sm/core/sm/shell/core/cli():125 > trace_flags=all | |
| +/opt/sm/core/sm/shell/core/cli:127 /opt/sm/core/sm/shell/core/cli():127 > export debug_flag debug_flags trace_flag trace_flags verbose_flag extension_args sm_script var_debug_flags var_debug_type_flag | |
| +/opt/sm/bin/sm:29 /opt/sm/bin/sm():29 > . /opt/sm/core/sm/shell/core/initialize | |
| +/opt/sm/core/sm/shell/core/initialize:4 /opt/sm/core/sm/shell/core/initialize():4 > setopt EXTENDED_GLOB NULL_GLOB HASH_CMDS WARN_CREATE_GLOBAL | |
| +/opt/sm/core/sm/shell/core/initialize:6 /opt/sm/core/sm/shell/core/initialize():6 > saved_sm_path=/opt/sm | |
| +/opt/sm/core/sm/shell/core/initialize:9 /opt/sm/core/sm/shell/core/initialize():9 > file=/etc/smrc | |
| +/opt/sm/core/sm/shell/core/initialize:11 /opt/sm/core/sm/shell/core/initialize():11 > [[ -s /etc/smrc ]] | |
| +/opt/sm/c |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| #!/bin/bash | |
| # License: Public Domain. | |
| # Author: Joseph Wecker, 2012 | |
| # | |
| # Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile? | |
| # Are you tired of trying to remember how darwin/mac-osx treat them differently from linux? | |
| # Are you tired of not having your ~/.bash* stuff work the way you expect? | |
| # | |
| # Symlink all of the following to this file: | |
| # * ~/.bashrc |
| #!/usr/bin/env python | |
| """ | |
| An objectifier for python data structures based on standard containers. | |
| Based on sveral answers to this stackoverflow question: | |
| http://stackoverflow.com/q/1305532/116957 | |
| Licensed under Creative Commons Attribution-ShareAlike | |
| http://creativecommons.org/licenses/by-sa/3.0/ | |
| """ |
| #!/usr/bin/env bash | |
| set -e | |
| if [[ $1 != '__testrun__' ]]; then | |
| sed '1,/^#BEGINEVAL/d' "$BASH_SOURCE" | |
| exit 0 | |
| fi | |
| #BEGINEVAL |
| class Matcher(object): | |
| """ | |
| A more convenient way to check regex matches. It holds the latest match | |
| result for further checks. | |
| The current regex match mechanism does not allow for checking matches in | |
| if/elif chains. Thanks to Matcher now one can do this: | |
| >>> m = Matcher() | |
| >>> s = "ba" |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: