Skip to content

Instantly share code, notes, and snippets.

View basepi's full-sized avatar

Colton Myers basepi

View GitHub Profile
@basepi
basepi / brewDoctorOutput.log
Created April 26, 2011 04:13
Failed brew output for cmake
brew doctor
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:999: command not found: mount
Your OS X is ripe for brewing.
Any troubles you may be experiencing are likely purely psychosomatic.
@basepi
basepi / if_vs_elif.py
Created May 23, 2011 03:54
if vs elif
number = 5
# Here, number will print twice
if number < 6:
print(num)
if number < 7:
print(num)
# Here, number will only print once
if number < 6:
@basepi
basepi / .vimrc
Created May 26, 2011 17:19
Pre-7.3 Vim Colorcolumn-like hack
" 80-character limit highlighting for vim <7.3 Replace colorcolumn commands with
" the following commands
" Highlight 78-80 in 'Search' color
au BufWinEnter * let w:m1=matchadd('Search', '\%<81v.\%>77v', -1)
" Highlight past column 80 in 'ErrorMsg' color
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
" Highlight only column 81 (when it has characters in it)
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%81v.\+', -1)
@basepi
basepi / eratosthene.py
Created May 30, 2011 02:34
Eratosthenes Sieve
def eratosthenes_sieve(n):
# Create a candidate list within which non-primes will be
# marked as None; only candidates below sqrt(n) need be checked.
candidates = list(range(n+1))
fin = int(n**0.5)
# Loop over the candidates, marking out each multiple.
for i in xrange(2, fin+1):
if candidates[i]:
candidates[2*i::i] = [None] * (n//i - 1)
@basepi
basepi / exception.txt
Created November 1, 2011 16:47
Python Regex Question
Traceback (most recent call last):
File "/usr/local/bin/../Cellar/python3/3.2.2/lib/python3.2/functools.py", line 176, in wrapper
result = cache[key]
KeyError: (<class 'str'>, '(^.*def\\W*)(\\w+)\\W*\\((.*)?\\):', 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./pickout_fn_defs.py", line 25, in <module>
FnDefRe = re.compile(r'(^.*def\W*)(\w+)\W*\((.*)?\):')
@basepi
basepi / zsh_dump.txt
Created November 19, 2011 20:26
ZSH dump
Last login: Sat Nov 19 13:25:30 on ttys002
Apple_PubSub_Socket_Render=/tmp/launch-gpsYzj/Render
CLICOLOR=Yes
COLORFGBG='12;8'
COMMAND_MODE=unix2003
DISPLAY=:0.0
DOT_PATH=/Applications/Graphviz.app/Contents/MacOS
EDITOR=vim
HAVE_DOT=YES
HOME=/Users/crakdmirror
@basepi
basepi / brew-install.log
Created December 13, 2011 01:38
VisualBoyAdvance brew install log
brew install --use-gcc visualboyadvance [18:30:27]
==> Downloading http://downloads.sourceforge.net/project/vba/VisualBoyAdvance/1.7.2/VisualBoyAdvance-src-1.7.2.tar.gz
File already downloaded in /Users/crakdmirror/Library/Caches/Homebrew
==> Patching
patching file src/System.h
patching file src/prof/prof.cpp
patching file src/sdl/debugger.cpp
==> ./configure --disable-debug --prefix=/usr/local/Cellar/visualboyadvance/1.7.2 --enable-c-core --without-mmx --enable-sdl --disable-sdltest
==> make
Making all in m4
@basepi
basepi / pythonfunctiontest.py
Created March 16, 2012 00:09 — forked from hixsondane/pythonfunctiontest
random python functions
def list_benefits():
benefit = ["More organized code","More readable code","Easier code reuse","Allowing programmers to share and connect code together"]
return benefit
#def build_sentence(benefit):
# for list in benefit:
# print "%s is a benefit of functions!" % benefit
def name_the_benefits_of_functions():
list_of_benefits = list_benefits()
@basepi
basepi / make.log
Created March 21, 2012 02:01
CPython: Results of `make -s -j2`
/usr/bin/ranlib: file: libpython3.3dm.a(dynamic_annotations.o) has no symbols
/usr/bin/ranlib: file: libpython3.3dm.a(pymath.o) has no symbols
/usr/bin/ranlib: file: libpython3.3dm.a(dynamic_annotations.o) has no symbols
/usr/bin/ranlib: file: libpython3.3dm.a(pymath.o) has no symbols
/usr/bin/ranlib: file: libpython3.3dm.a(dynamic_annotations.o) has no symbols
/usr/bin/ranlib: file: libpython3.3dm.a(pymath.o) has no symbols
ranlib: file: libpython3.3dm.a(dynamic_annotations.o) has no symbols
ranlib: file: libpython3.3dm.a(pymath.o) has no symbols
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
@basepi
basepi / trace.txt
Created January 18, 2013 01:58
Trace from running gitlab setup
[cmyers@ns2] [/home/gitlab/gitlab] [4-0-stable]
± sudo -u gitlab -H bundle exec rake gitlab:app:setup RAILS_ENV=production --trace [18:55:50]
rake aborted!
cannot load such file -- omniauth/google/oauth2
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:74:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:74:in `rescue in block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:62:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'