This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class IPRange { | |
private $BITS = 256; | |
public function __construct($start, $end) { | |
$this->start = $start; | |
$this->end = $end; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cherrypy | |
from pprint import pformat | |
class Root(object): | |
"""A default class for cherrypy that prints the request env. | |
""" | |
@cherrypy.expose | |
def index(self, *args, **kw): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make[1]: Entering directory `/home/eric/Source/temp/xpyb/src' | |
/usr/bin/python ./py_client.py -p /usr/local/lib/python2.7/site-packages /usr/local/share/xcb/dri2.xml | |
Traceback (most recent call last): | |
File "./py_client.py", line 620, in <module> | |
module.resolve() | |
File "/usr/lib/pymodules/python2.7/xcbgen/state.py", line 94, in resolve | |
item.resolve(self) | |
File "/usr/lib/pymodules/python2.7/xcbgen/xtypes.py", line 405, in resolve | |
self.reply.resolve(module) | |
File "/usr/lib/pymodules/python2.7/xcbgen/xtypes.py", line 369, in resolve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/bin/python ./py_client.py -p /usr/local/lib/python2.7/site-packages /usr/local/share/xcb/dri2.xml | |
Traceback (most recent call last): | |
File "./py_client.py", line 620, in <module> | |
module.resolve() | |
File "/usr/lib/pymodules/python2.7/xcbgen/state.py", line 94, in resolve | |
item.resolve(self) | |
File "/usr/lib/pymodules/python2.7/xcbgen/xtypes.py", line 405, in resolve | |
self.reply.resolve(module) | |
File "/usr/lib/pymodules/python2.7/xcbgen/xtypes.py", line 369, in resolve | |
ComplexType.resolve(self, module) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A file lock implementation that tries to avoid platform specific | |
issues. It is inspired by a whole bunch of different implementations | |
listed below. | |
- https://bitbucket.org/jaraco/yg.lockfile/src/6c448dcbf6e5/yg/lockfile/__init__.py | |
- http://svn.zope.org/zc.lockfile/trunk/src/zc/lockfile/__init__.py?rev=121133&view=markup | |
- http://stackoverflow.com/questions/489861/locking-a-file-in-python | |
- http://www.evanfosmark.com/2009/01/cross-platform-file-locking-support-in-python/ | |
- http://packages.python.org/lockfile/lockfile.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
CP Cluster | |
Create a cluster of CherryPy application processes. This will take an | |
single cherrypy application and create multiple instances on | |
difference processes using sequential port numbers. | |
""" | |
from __future__ import print_function | |
import os | |
import tempfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changes in HEAD | |
Modified circus/config.py | |
diff --git a/circus/config.py b/circus/config.py | |
index abce19a..d789545 100644 | |
--- a/circus/config.py | |
+++ b/circus/config.py | |
@@ -28,8 +28,7 @@ def watcher_defaults(): | |
'max_retry': 5, | |
'graceful_timeout': 30, | |
'rlimits': dict(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun narrow-to-region-indirect (start end) | |
"Restrict editing in this buffer to the current region, indirectly." | |
(interactive "r") | |
(let ((buf (clone-indirect-buffer nil nil))) | |
(with-current-buffer buf | |
(narrow-to-region start end)) | |
(select-frame (make-frame)) | |
(switch-to-buffer buf))) | |
(global-set-key (kbd "C-c \"") 'narrow-to-region-indirect) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* My Emacs Customizations | |
** The Vendor Directory | |
I keep all my non-packages in =.emacs.d/vendor=. | |
#+begin_src emacs-lisp | |
(add-to-list 'load-path "~/.emacs.d/vendor") | |
#+end_src | |
** Packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |
OlderNewer