Skip to content

Instantly share code, notes, and snippets.

@bar
bar / .gitconfig
Last active Jun 30, 2020
git alias
View .gitconfig
[push]
default = simple
[fetch]
prune = true
[user]
name = Ber Clausen
[core]
ignorecase = true
[filter "lfs"]
clean = git-lfs clean -- %f
View .pdbrc
# Print a dictionary, sorted. %1 is the dict, %2 is the prefix for the names.
alias p_ for __k, __v in sorted(%1.items()): print("{}{:<15}= {!r:<80.80}".format("%2", __k, __v))
# Print the member variables of a thing.
alias pi p_ %1.__dict__ %1.
# Print the member variables of self.
alias ps pi self
# Print the locals.
@bar
bar / requests_ssl_session.py
Last active Jun 28, 2016
requests.ssl_session
View requests_ssl_session.py
from __future__ import absolute_import
import ssl
from requests import session
from requests.adapters import HTTPAdapter, DEFAULT_POOLBLOCK
from requests.packages.urllib3.poolmanager import PoolManager, SSL_KEYWORDS
try:
# python >=2.7.9
@bar
bar / gist:4015025
Created Nov 5, 2012
http_build_query() vs. buildQuery() - 100000 iterations (3 passes)
View gist:4015025
/**
* 100000 iterations x pass (3 passes)
* Router::queryString() uses http_build_query()
* Router::queryString2() uses buildQuery()
* Router::url() uses Router::queryString()
* Router::url2() uses Router::queryString2()
*/
/**
* Router::url()
View keybase.md

Keybase proof

I hereby claim:

  • I am bar on github.
  • I am bar (https://keybase.io/bar) on keybase.
  • I have a public key whose fingerprint is FA93 CD7B F2EE 5868 8A38 C0C7 D405 0F0F C5E1 5B81

To claim this, I am signing this object: