Skip to content

Instantly share code, notes, and snippets.

@kwarunek
kwarunek / sniff.txt
Created April 5, 2016 11:21 — forked from manifestinteractive/sniff.txt
A friendly formatter for curl requests to help with debugging.
\n
============= HOST: ==========\n
\n
local_ip: %{local_ip}\n
local_port: %{local_port}\n
remote_ip: %{remote_ip}\n
remote_port: %{remote_port}\n
\n
======= CONNECTION: ==========\n
\n
@kwarunek
kwarunek / gist:d939ebd9bbea4fa16c85
Last active February 8, 2016 06:08 — forked from nhoad/gist:8966377
Async stdio with asyncio
import os
import asyncio
import sys
from asyncio.streams import StreamWriter, FlowControlMixin
reader, writer = None, None
@asyncio.coroutine
def stdio(loop=None):
@kwarunek
kwarunek / benchmark.py
Created January 19, 2016 13:05 — forked from eamartin/benchmark.py
Python JSON Benchmark
'''cjson, jsonlib, simplejson, and yajl also use C code
demjson did not use C code, but was too painfully slow to benchmark
(took about 20 seconds for these tests)
'''
import json
import sys
import time
with open('doc.json') as f:
@kwarunek
kwarunek / gist:560451aff5ff23bf4436
Last active August 29, 2015 14:07 — forked from mcansky/gist:3434417
aws get s3 expired url
# encoding : utf-8
require 'openssl'
require 'digest/sha1'
require 'base64'
module Aws
extend self
def signed_url(path, expire_date)
digest = OpenSSL::Digest::Digest.new('sha1')
can_string = "GET\n\n\n#{expire_date}\n/#{S3_BUCKET}/#{path}"
import itertools
import functools
import fnmatch
import os
from StringIO import StringIO
import yaml
from yaml.parser import ParserError
import voluptuous as V