Skip to content

Instantly share code, notes, and snippets.

View stavxyz's full-sized avatar
😿

samuel stavxyz

😿
View GitHub Profile
@stavxyz
stavxyz / callforhelp.md
Created June 2, 2014 14:55
This American Life (podcast) - Sailing Story
{
    "cpu": {
        "0": {
            "cache_size": " KB",
            "cores": 1,
            "family": "1",
            "mhz": "2594",
            "model": "11527",
            "model_name": "Intel64 Family 6 Model 45 Stepping 7",
@stavxyz
stavxyz / minimal.md
Last active August 29, 2015 13:57
--minimal ( still mostly broken )

#the state of things with --minimal

What I have here is part conundrum, part dilemma, and part quagmire, but not really anything in between.

To demonstrate what it's been like trying to implement this...
quagmire

Though unlike Heisenberg I can confidently say I never willfully made things worse.

###skip to the tl;dr

@stavxyz
stavxyz / logging.py
Created March 10, 2014 19:33
python logging config
import logging
import socket
import logging
import logging.config
import logstash
test1 = {"version": 1,
"loggers": {
"test1": {
{ "trigger": ...,
"credentials": {
"host": [
{
//Used for any host (pooled)
"username": "root",
"private-key": "----BEGIN ... KEY----",
},
{
@stavxyz
stavxyz / exc_dict.md
Created February 5, 2014 16:06
create useful little dicts related to an exception
def exc_dict():
    """Expects to be called from within an exception handling block as in:
            try:
                foo()
            except Exception:
                print exc_dict()

    Creates a nice array of dictionaries each of which describes
    a part of the traceback:

sample workflow

$ hookie show -u smlstvnh -r hookie
------------------------------------
 ### WEBHOOKS ON smlstvnh:hookie ###
------------------------------------

Nothing yet. Let me create one.

@stavxyz
stavxyz / red.py
Created December 30, 2013 16:28
redis string from connection_string
import urlparse
from redis import Redis
from waldo.common import config
conf = config.current()
dbstring = conf['connection_string']
dbstring = urlparse.urlparse(dbstring)
dbstring = "redis://" + dbstring.netloc + ":6329"
"""
Example for a colourised logging output.
This example uses "blessings" to handle console escape sequences. ``blessings``
itself is a very harmless package in that it does not have any external
dependencies. And it's code-base is very clean and small.
The example extends the core logging formatter (logging.Formatter) and
colourises the complete line. This takes advantage of any upstream updates
related to logging. When writing this against Python 2.7, the parent code

san/desan using ujson

  • standard read/write
    • 1.23 ms
  • sysinfo block read/write
    • 97.7 ms

SON Manipulator

  • standard read/write
    • .75 ms
  • sysinfo block read/write