Skip to content

Instantly share code, notes, and snippets.

View richo's full-sized avatar

richö butts richo

View GitHub Profile
#!/bin/sh
nc -kl 8080 < /tmp/socks_proxy.fifo | tee /dev/stderr | nc localhost 80 | tee /tmp/socks_proxy.sock
# This is redundant with the new implementation
mkfifo /tmp/socks_proxy.fifo
inputmode.cpp
src/mode/inputmode.cpp: In member function 'std::string Ui::InputMode::SearchHistory(Ui::InputMode::Direction, const std::string&)':src/mode/inputmode.cpp:216: error: no match for 'operator==' in 'historyIterator == std::vector<_Tp, _Alloc>::rend() [with _Tp = std::string, _Alloc = std::allocator<std::string>]()'
src/mode/inputmode.cpp:223: error: no match for 'operator<' in 'historyIterator < std::vector<_Tp, _Alloc>::rend() [with _Tp = std::string, _Alloc = std::allocator<std::string>]()'
src/mode/inputmode.cpp:228: error: no match for 'operator==' in 'historyIterator == std::vector<_Tp, _Alloc>::rend() [with _Tp = std::string, _Alloc = std::allocator<std::string>]()'
src/mode/inputmode.cpp:232: error: no match for 'operator>=' in 'historyIterator >= std::vector<_Tp, _Alloc>::rbegin() [with _Tp = std::string, _Alloc = std::allocator<std::string>]()'
src/mode/inputmode.cpp:237: error: no match for 'operator<' in 'historyIterator < std::vector<_Tp, _Alloc>::rbegin() [with _Tp = std::string, _All
@richo
richo / iterator.py
Created February 10, 2012 14:22
Blog post comparing ruby to python
class Iter(object):
def __init__(self):
self.count = 0
self.final = 10
def __iter__(self):
return self
def next(self):
@richo
richo / openbox_divvy.xml
Created February 29, 2012 22:03
Bindings to make window management simple in openbox
<keybind key="W-Escape">
<keybind key="q">
<action name="Close"/>
</keybind>
<!-- Keybindings for resizing, ala divvy -->
<!-- 30% -->
<keybind key="C-h">
<action name="MoveResizeTo">
<x>0</x>
<height>98%</height>
#!/usr/bin/env zsh
function __richo_pwd()
{
local current=$PWD
richo_prompt=no
if [ -e ".svn" ]; then
export richo_prompt="⚡"
fi
while [ "$current" != '/' -a $richo_prompt = "no" ]; do
# for n in n; do
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDtkoBcl8jYV7X+Jue4C/b3yKGrtWilYFpDhcIPQQ5zhmeOoyY0swGKf6c4iGe27Ve3A5Quvn06UKJVq3HwDaNIxazhNoj/Tvo/QUsOWlMbXZZOA9eey8dS9jji+iDeOUsyaLEaX0sc36rZs4g9WLbMuP62hXB00KjAqnA5G+3HsR+QQ7PhbzRsOH6oLfULoxXDl/hOD+/jCkvxFL7a/h844KtPHGwrBOX+jQnoKyupQKxbqzv5u5nvcrNr3gj+VICad5JZ9TLELAt0Lvcr5Vw2GTWKyU7L1TJMar/+w+AYsZpGdeTOcg/AdgI5wk01LFgUSLKLBcj+jlOS8X8UCtnk4aZhg4YJBWn5QeQEuvs9/Zngqwb3CforkHgBehihD4Gczc0qLGhQjOMS4plY05nWxMD80qAN9i0nCTCz1JhUFWPXnDa4c4P/w1Ze3nMfmdDzWjq0s79G/s0MYIIX9Mq7gjucHWIr/eTSklOjCCPzcbIYuA/wC0NUDyUMFJZ1x0MlJBsw4vjte1Mo//eWRMuX1L16wtGyi1yC93Zvq/teGKfyShbjgWmcPly/58fLEtmAQExL/owpTzIgl4XC717B2/C+bBChwBMqLaQvgOcBoi3PvSP0T8NHGWY1E3w1hCANL7m5IFfUwiG2p/hPB/oqBoKMm0ihVWUqygqPiY/zhw== richo@richo-mbp.local
[Wed, 21 Mar 2012 17:34:42 -0700] INFO: Processing php_pear[imagick] action install (99designs::cont
ests line 28)
[Wed, 21 Mar 2012 17:34:46 -0700] INFO: Installing php_pear[imagick] version 2.3.0
[Wed, 21 Mar 2012 17:34:59 -0700] INFO: Processing php_pear[geoip] action install (99designs::contes
ts line 28)
[Wed, 21 Mar 2012 17:35:00 -0700] INFO: Installing php_pear[geoip] version 1.0.8
[Wed, 21 Mar 2012 17:35:06 -0700] ERROR: php_pear[geoip] (99designs::contests line 28) has had an er
ror
[Wed, 21 Mar 2012 17:35:06 -0700] ERROR: php_pear[geoip] (/home/richo/vmconfig/cookbooks/99designs/r
ecipes/contests.rb:28:in `from_file') had an error:
require 'twat'
require 'mocha'
require 'pry'
describe Twat do
# before(:each) do
# end
class MyString(str):
def processed(self):
half1 = self[0:10].rstrip(' ')
half2 = self[11:].rstrip('\n')
return [half1, half2]
def reflect_statement(sentence):
elements = []
sensplit = []