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 os | |
| import sublime_plugin | |
| class NewFilePopupCommand(sublime_plugin.WindowCommand): | |
| def run(self): | |
| self.build_directory_tree() | |
| self.window.show_quick_panel(self.labels, self.directory_selected) | |
| def build_directory_tree(self): |
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
| [ | |
| { | |
| "class": "tab_label", | |
| "settings": ["highlight_modified_tabs"], | |
| "parents": [{"class": "tab_control", "attributes": ["dirty"]}], | |
| "fg": [120, 170, 250] | |
| }, | |
| // QUICKPANEL SELECTED HIGHLIGHT | |
| { |
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 wtforms | |
| class DummyPostData(dict): | |
| def getlist(self, key): | |
| v = self[key] | |
| if not isinstance(v, (list, tuple)): | |
| v = [v] | |
| return v |
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
| # pub.py | |
| import json | |
| import redis | |
| import time | |
| r = redis.StrictRedis() | |
| channels = range(1000) | |
| messages_per_channel = 1000 |
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
| def purify(numbers): | |
| return [i for i in numbers if i % 2 == 0] |
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
| """ | |
| This is a simple benchmark that tests the performance of several | |
| locking implementations. Each example implements a connection | |
| pool that provides `get_connection()` to retrieve a connection | |
| from the pool and `release()` to return a connection back to the | |
| pool. | |
| The `test()` function creates an instance of `pool_class` and | |
| creates `num_threads` `threading.Thread` instances that simply call | |
| `pool.get_connection()` and `pool.release()` repeatedly until |
OlderNewer