Skip to content

Instantly share code, notes, and snippets.

---
timestamp: 2015-04-27 17:05:34 UTC
kitchen_version: 1.3.1
loader:
process_erb: true
process_local: true
process_global: true
global_config:
project_config:
filename: "/Users/eric8549/Work/cookbook-designate-panama/.kitchen.yml"
def test_read_version_three(self, url):
original_resp = requests.get(url)
# data = original_resp.content
req = original_resp.request
resp = self.serializer.loads(
req, self.serializer.dumps(
req,
original_resp.raw
),
def test_read_version_three(self, url):
original_resp = requests.get(url)
data = original_resp.content
req = original_resp.request
resp = self.serializer.loads(
req, self.serializer.dumps(
req,
original_resp.raw
),
# Need to find the IP address so we'll wrap socket.connect to print
# the addr info
def logging_connect(self, addr, *args, **kw):
log('%s:%s', *addr)
return socket.socket._original_connect(self, addr, *args, **kw)
socket.socket._original_connect = socket.socket.connect
socket.socket.connect = logging_connect
~/Projects/has_bson $ virtualenv venv
New python executable in venv/bin/python
Installing setuptools, pip...done.
~/Projects/has_bson $ venv/bin/pip install pymongo
Downloading/unpacking pymongo
Using download cache from /home/eric/.pip/download_cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fp%2Fpymongo%2Fpymongo-2.7.2.tar.gz
Running setup.py (path:/home/eric/Projects/has_bson/venv/build/pymongo/setup.py) egg_info for package pymongo
Installing collected packages: pymongo
Running setup.py install for pymongo
(ns cachej.core
(:require [clj-http.client :as client]
[clojure.string :as string]
[url-normalizer.core :as urlnorm]
[ring.util.time :as t]))
(require 's)
(defun nm/run (cmd)
"Run CMD and return the output as a chomp'd string."
(s-chomp (shell-command-to-string cmd)))
(defconst nm-buffer-name "*nm*"
"Name of NetworkManager mode buffer.")
(defn col-map {"Email" "email"
"First Name" "firstname"
"Last Name" "lastname"
"Birthdate" "birthdate"
"Acquisition Date" "notes"
"Billing Address 1" "address"
"Billing Address 2" "address2"
"Billing City" "city"
"Billing State/Province" "state"
"Billing Country" "country"
craps.core=> (def my-list '(1 2 3 4))
#'craps.core/my-list
craps.core=> (map println my-list)
(1
2
nil 3
nil 4
nil nil)
craps.core=> (map print my-list)
(12nil 3nil 4nil nil)
@ionrock
ionrock / gist:7993530
Last active December 31, 2015 13:29
Adding some functions to read a project's procfile entries into prodigy. I use a tool called "xe" that does something similar to projectile in that it looks for a project root and appends venv/bin to your path before running commands. It also has some helpers to bootstrap a python virtualenv and run django manage commands. It makes these sorts o…
(defun my-procfile-name-from-line (line)
(car (split-string line ":")))
(defun my-procfile-names (procfile)
(with-temp-buffer
(insert-file-contents procfile)
(-map 'my-procfile-name-from-line (split-string (buffer-string) "\n" t))))
(defun my-procfile-cmd (procfile name)
(with-temp-buffer