Skip to content

Instantly share code, notes, and snippets.

PYPY_USESSION_BASENAME='-' python pypy/translator/goal/translate.py --batch --source --opt=jit pypy/translator/goal/targetpypystandalone --allworkingmodules
Recent stdout:
gcc -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused -DPy_BUILD_CORE -msse2 -mfpmath=sse -DPYPY_CPU_HAS_STANDARD_PRECISION -frandom-seed=implement_72.c -o implement_72.s -S implement_72.c -I/home/ieure/pypy/1.5/pypy-1.5/pypy/translator/c -I/home/ieure/pypy/1.5/pypy-1.5/pypy/module/cpyext/include -I..
implement_72.c: In function ‘pypy_g_ccall_RAND_add__arrayPtr_INT_Float_reload’:
implement_72.c:62419: warning: implicit declaration of function ‘RAND_add’
/usr/bin/python /home/ieure/pypy/1.5/pypy-1.5/pypy/translator/c/gcc/trackgcroot.py -mmain -t implement_72.s > implement_72.gctmp
mv implement_72.gctmp implement_72.gcmap
gcc -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused -DPy_BUILD_CORE -msse2 -mfpmath=sse -DPYPY_CPU_HAS_STANDARD_PRECISION -frandom-seed=implement_73.c -o implement_73.s -S implement_73.c -I/home/ieure/pypy/1.5/pypy-1.
$ sudo port install s3cmd
---> Computing dependencies for s3cmd
---> Dependencies to be installed: python25
---> Fetching python25^C^C^C
$ cat input
alice
bob
carol
dave
eve
$ y nl nl < input
1 alice
1 bob
2 carol
(eval-after-load "magit"
'(progn
(defun magit-browse-github (commit)
"Open a browser pointing to the tracked branch on GitHub.
With prefix argument, go to the commit HEAD is at."
(interactive "p")
(let* ((branch (magit-get-current-branch))
(remote (and branch (magit-get "branch" branch "remote")))
(remote-branch (or (and branch (magit-remote-branch-for branch))
@ieure
ieure / throttle.py
Created March 3, 2011 20:07
Example of a class which can be used as a decorator or context manager.
import time
from functools import wraps
class throttle(object):
"""Throttle calls to a method by `factor'."""
def __init__(self, factor, error_only=False):
self.factor = factor
(defun local-path (path)
"Return the local portion of a path.
If PATH is local, return it unaltered.
If PATH is remote, return the remote diretory portion of the path."
(if (tramp-tramp-file-p path)
(elt (tramp-dissect-file-name path) 3)
path))
(defun python-find-python-command (&optional root)
@ieure
ieure / toggle-root.el
Created January 19, 2011 02:45
Toggle between root and non-root users
(defun find-file-as-root ()
"Find a file as root."
(interactive)
(let* ((parsed (when (tramp-tramp-file-p default-directory)
(coerce (tramp-dissect-file-name default-directory)
'list)))
(default-directory
(if parsed
(apply 'tramp-make-tramp-file-name
(append '("sudo" "root") (cddr parsed)))
(defun locate-tags-file (&optional dir)
"Locate a TAGS or TAGS.gz file in DIR or a parent directory."
(let ((dir (or dir default-directory))
(tag-files '("TAGS" "TAGS.gz"))
(tag-dir)
(tag-file))
(while (and (not tag-file) tag-files)
(let ((potential-file (car tag-files)))
(setq tag-files (cdr tag-files))
structure = (
(('one', 'two'), 'three'),
(('four', 'five'), 'six'),
)
((one, three) for ((one, two), three) in structure)
# -> (('one', 'three'), ('four', 'six'))
(defun newline-above-current-line ()
"Create a new line above the current line"
(interactive)
(beginning-of-line)
(newline-and-indent)
(previous-line)
(indent-according-to-mode))