Skip to content

Instantly share code, notes, and snippets.

View andymccurdy's full-sized avatar

Andy McCurdy andymccurdy

  • San Francisco, CA
View GitHub Profile
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):
[
{
"class": "tab_label",
"settings": ["highlight_modified_tabs"],
"parents": [{"class": "tab_control", "attributes": ["dirty"]}],
"fg": [120, 170, 250]
},
// QUICKPANEL SELECTED HIGHLIGHT
{
import wtforms
class DummyPostData(dict):
def getlist(self, key):
v = self[key]
if not isinstance(v, (list, tuple)):
v = [v]
return v
# pub.py
import json
import redis
import time
r = redis.StrictRedis()
channels = range(1000)
messages_per_channel = 1000
def purify(numbers):
return [i for i in numbers if i % 2 == 0]
"""
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