Skip to content

Instantly share code, notes, and snippets.

Ian Eure ieure

Block or report user

Report or block ieure

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ieure
ieure / tiling
Created Mar 17, 2009
Code to handle centering and tiling of Emacs frames
View tiling
;; Functions to work with frames
(provide 'ime-frame)
(defun screen-usable-height (&optional display)
"Return the usable height of the display.
Some window-systems have portions of the screen which Emacs
cannot address. This function should return the height of the
screen, minus anything which is not usable."
View gist:141615
ieure!neutron:~/Projects/Cassandra$ nosetests
EEEEEEEEFEFEFEFEFEFEFEFEEFEFEFEFEFEFE
======================================================================
ERROR: system.test_server.TestMutations.test_bad_calls
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/local/lib/python2.5/site-packages/nose/case.py", line 366, in tearDown
try_run(self.inst, ('teardown', 'tearDown'))
File "/opt/local/lib/python2.5/site-packages/nose/util.py", line 453, in try_run
return func()
View gist:141649
ieure!neutron:~/Projects/Cassandra$ sh -x bin/cassandra -p cassandra.pid
+ '[' x = x ']'
++ dirname bin/cassandra
+ for include in /usr/share/cassandra/cassandra.in.sh /usr/local/share/cassandra/cassandra.in.sh /opt/cassandra/cassandra.in.sh '`dirname $0`/cassandra.in.sh'
+ '[' -r /usr/share/cassandra/cassandra.in.sh ']'
+ for include in /usr/share/cassandra/cassandra.in.sh /usr/local/share/cassandra/cassandra.in.sh /opt/cassandra/cassandra.in.sh '`dirname $0`/cassandra.in.sh'
+ '[' -r /usr/local/share/cassandra/cassandra.in.sh ']'
+ for include in /usr/share/cassandra/cassandra.in.sh /usr/local/share/cassandra/cassandra.in.sh /opt/cassandra/cassandra.in.sh '`dirname $0`/cassandra.in.sh'
+ '[' -r /opt/cassandra/cassandra.in.sh ']'
+ for include in /usr/share/cassandra/cassandra.in.sh /usr/local/share/cassandra/cassandra.in.sh /opt/cassandra/cassandra.in.sh '`dirname $0`/cassandra.in.sh'
View gist:142960
.EEEEEEEEFEEEFEEEEEE.EEEEEEEEEEE
======================================================================
ERROR: system.test_server.TestMutations.test_batch_insert
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/local/lib/python2.5/site-packages/nose/case.py", line 182, in runTest
self.test(*self.arg)
File "/Users/ieure/Projects/cassandra-trunk/test/system/test_server.py", line 126, in test_batch_insert
_verify_batch()
File "/Users/ieure/Projects/cassandra-trunk/test/system/test_server.py", line 45, in _verify_batch
View gist:150933
#! /usr/bin/env clj
(ns foo)
(prn "Hello")
View gist:150935
neutron!ieure:~/Projects/clojure/foo/src$ ./foo.clj
"Hello"
Exception in thread "main" java.io.FileNotFoundException: --./foo.clj (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at clojure.lang.Compiler.loadFile(Compiler.java:4821)
at clojure.main$load_script__5833.invoke(main.clj:206)
at clojure.main$init_opt__5836.invoke(main.clj:211)
at clojure.main$initialize__5846.invoke(main.clj:239)
View gist:152194
(defun php-lint ()
"Performs a PHP lint-check on the current file."
(interactive)
(require 'compile)
(let* ((compilation-error-regexp-alist '(php))
(compilation-error-regexp-alist-alist ())
(tramp (tramp-tramp-file-p (buffer-file-name)))
(file (or (and tramp
(aref (tramp-dissect-file-name (buffer-file-name)) 3))
(buffer-file-name))))
@ieure
ieure / star.py
Created Sep 14, 2009
Functional version of the Python */** operators
View star.py
# -*- coding: utf-8 -*-
#
# Author: Ian Eure <ian@digg.com>
#
"""Star function."""
from functools import partial
import unittest
@ieure
ieure / error_debug.py
Created Sep 25, 2009
Context manager to enter the Python debugger when an exception is raised
View error_debug.py
# -*- coding: utf-8 -*-
#
# Author: Ian Eure <http://github.com/ieure>, <http://atomized.org>
#
"""Enter the debugger on exceptions.
example:
from __future__ import with_statement
View retry.py
from functools import partial
from itertools import imap
from operator import or_
def retry(ntimes=3, ignore=None, trap=None):
"""Retry an operation some number of times.
The ignore and trap arguments may be a sequence (or a single)
exception class. If the decorated function raises an exception
matching ignore, it will be raised.
You can’t perform that action at this time.