This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Haven't figured out how to modify tracebacks yet, since traceback.tb_next | |
| # is read-only. I don't want to go the proxy route that jinja did, because | |
| # while it's brilliant (as usual) it's not clean. See `_init_ugly_crap` | |
| # Reference: https://github.com/mitsuhiko/jinja2/blob/master/jinja2/debug.py | |
| # This is what I'd LIKE to be able to do: | |
| internal_code = set() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "always_show_minimap_viewport": true, | |
| "auto_complete_delay": 200, | |
| "bold_folder_labels": true, | |
| "caret_extra_width": 1, | |
| "color_scheme": "Packages/Bubububububad and Boneyfied Color Schemes/Boneyfied.tmTheme", | |
| "draw_minimap_border": true, | |
| "ensure_newline_at_eof_on_save": true, | |
| "file_exclude_patterns": | |
| [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import functools | |
| import time | |
| import requests | |
| DEFAULT_MAX_ATTEMPTS = 4 | |
| DEFAULT_BACKOFF_COEFF = 50.0 | |
| def default_backoff_func(operation, attempts): | |
| ''' attempts is the number of calls so far that have failed ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git | |
| gitgutter | |
| package control | |
| sidebarenhancements | |
| sublimelinter | |
| sublimelinter-flake8 | |
| sublimelinter-jshint | |
| theme - sodareloaded | |
| sass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name CleanTwitchHomepage | |
| // @namespace https://numberoverzero.com | |
| // @description clean up the twitch homepage to get to the shit I care about | |
| // @include http://www.twitch.tv/ | |
| // @include https://www.twitch.tv/ | |
| // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js | |
| // @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
| // @version 2 | |
| // @grant GM_addStyle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| missing = object() | |
| class Value: | |
| ''' | |
| Simple class that enables `await value.wait_for(foo)` to wait until the | |
| variable is set to the expected value, without blocking the event loop. | |
| Loosely modeled after asyncio.Event and asyncio.Condition |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import botocore | |
| import boto3 | |
| import functools | |
| import time | |
| DEFAULT_BACKOFF_COEFF = 50.0 | |
| DEFAULT_MAX_ATTEMPTS = 4 | |
| MAX_BATCH_SIZE = 25 | |
| RETRYABLE_ERRORS = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import arrow | |
| import boto3 | |
| import uuid | |
| dynamodb = boto3.client('dynamodb') | |
| some_id = uuid.uuid4() | |
| some_time = arrow.now() | |
| request = { | |
| 'ConsistentRead': False, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import arrow | |
| import uuid | |
| some_id = uuid.uuid4() | |
| some_time = arrow.now() | |
| q = engine.query(Model) \ | |
| .forward(True).consistent(True) \ | |
| .key((Model.name == some_id) & (Model.date == some_time)) \ | |
| .filter(Model.joined == "today") \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user = User(id='foobar', email='foobar@domain.com') | |
| # Standard save, hoping we've got a unique id... | |
| engine.save(user) | |
| # Adding a condition | |
| expect = User.id.is_(None) | |
| engine.save(user, condition=expect) |