Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| /** | |
| * Utility lib for setting/unsetting JavaScript breakpoints | |
| * | |
| * Usage: | |
| * breakpoint.set('globalMethodName'); | |
| * breakpoint.unset('globalMethodName'); | |
| * | |
| * breakpoint.set('namespacedMethodName', namespaceObject); | |
| * breakpoint.unset('namespacedMethodName', namespaceObject); | |
| */ |
| import os | |
| from PIL import Image | |
| def extractFrames(inGif, outFolder): | |
| frame = Image.open(inGif) | |
| nframes = 0 | |
| while frame: | |
| frame.save( '%s/%s-%s.gif' % (outFolder, os.path.basename(inGif), nframes ) , 'GIF') | |
| nframes += 1 |
| #!/bin/bash | |
| # This hook is run after every virtualenv is activated. | |
| export OLD_GEM_HOME=$GEM_HOME | |
| export GEM_HOME=$VIRTUAL_ENV/gems/ | |
| export GEM_PATH= | |
| export PATH=$VIRTUAL_ENV/gems/bin:$PATH |
| #-*- coding: utf-8 -*- | |
| __version_info__ = { | |
| 'major': 0, | |
| 'minor': 1, | |
| 'micro': 0, | |
| 'releaselevel': 'alpha', | |
| 'serial': 1 | |
| } | |
| def get_version(short=False): |
| from django.db import models | |
| optional = dict(blank=True, null=True) | |
| class Foo(models.Model): | |
| bar = models.CharField() | |
| baz = models.CharField(**optional) |
| (function(d) { | |
| var dl = d.createElement('a'); | |
| dl.innerText = 'Download MP3'; | |
| dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1]; | |
| dl.download = d.querySelector('em').innerText+".mp3"; | |
| d.querySelector('.primary').appendChild(dl); | |
| dl.style.marginLeft = '10px'; | |
| dl.style.color = 'red'; | |
| dl.style.fontWeight = 700; | |
| })(document); |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| diff --git a/system/core/Kohana.php b/system/core/Kohana.php | |
| index 271f917..287c271 100644 | |
| --- a/system/core/Kohana.php | |
| +++ b/system/core/Kohana.php | |
| @@ -722,7 +722,7 @@ final class Kohana { | |
| if (ob_get_level() >= self::$buffer_level) | |
| { | |
| // Set the close function | |
| - $close = ($flush === TRUE) ? 'ob_end_flush' : 'ob_end_clean'; | |
| + $close = ($flush === TRUE) ? 'ob_end_flush' : 'Kohana::_ob_end_clean'; |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |