Skip to content

Instantly share code, notes, and snippets.

View weirdpercent's full-sized avatar

Drew Prentice weirdpercent

View GitHub Profile
@weirdpercent
weirdpercent / search.rb
Created April 16, 2014 23:02
Using open-uri to fetch URLs with error-handling.
require 'multi_json'
require 'open-uri/cached'
def search(url, result)
OpenURI::Cache.cache_path = 'tmp/open-uri'
uri=URI.parse(url)
status=uri.open.meta[:status]
if status[0] == "200"
result=MultiJson.load(uri.open.read)
else
puts "HTTP Status #{status[0]} #{status[1]}"
root_path = File.join(File.dirname(__FILE__), "../")
$LOAD_PATH.unshift(root_path)
require 'lib/peas'
@api = API.new
include GLI::App
reset # Used when this file is repetitively loaded by rspec
@weirdpercent
weirdpercent / gist:566d99252d055be1c266
Created October 31, 2014 18:41
Error while updating rubysl-openssl
/home/drew/.rvm/rubies/rbx-2.2.10/bin/rbx -r ./siteconf20141031-15160-1nk49ke.rb extconf.rb
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for assert.h... yes
checking for openssl/ssl.h... yes
checking for openssl/conf_api.h... yes
checking for SSL_library_init() in openssl/ssl.h with -Werror=deprecated-declarations... yes
checking for openssl/ssl.h... yes
checking for ERR_peek_last_error()... yes
checking for ASN1_put_eoc()... yes
@weirdpercent
weirdpercent / radium-build-error
Created March 7, 2015 12:35
Building Radium on Ubuntu 14
BUILDTYPE=RELEASE
if [ RELEASE = DEBUG ] ; then echo "-DDEBUG -Werror -Wall -g" >buildtype.opt ; else echo "-DRELEASE -DDEBUG -Wall -g -O3" >buildtype.opt ; fi
cd bin && /home/drew/.pyenv/shims/python2 generate_keyboard_sub_ids.py >../common/keyboard_sub_ids.h
bash check_dependencies.sh `./find_python_path.sh` moc uic test_build
g++ -mfpmath=sse -msse2 -c embedded_scheme/scheme.cpp -c `cat buildtype.opt` -Ibin/packages/gc-7.2/include -IQt/ -I/home/drew/.pyenv/versions/2.7.7/include/python2.7 -DNOPAUSEPLAY -DCOMPILING_RADIUM -DGUIISQT -DUSE_GFX_OP_QUEUE -DFULL_VERSION=1 -DIS_LITTLE_ENDIAN=1 -DUSE_OPENGL=1 -DUSE_QT_VISUAL=1 -DUSE_GTK_VISUAL=0 -DUSE_QT_REQTYPE=1 -DUSE_GTK_REQTYPE=0 -DUSE_QT_MENU=1 -DUSE_GTK_MENU=0 -Imidi/rtmidi -ansi -pedantic -Wall -O2 -Werror=array-bounds -msse2 -DFOR_LINUX -DWITH_PD -Wno-unused-function -DUSE_VESTIGE=1 -Wno-unused-function -DUSE_QT4 -DUSE_QIMAGE_BUFFER=1 `pkg-config --cflags Qt3Support --cflags QtOpenGL` -Ibin/packages/qhttpserver-master/src -DQHTTPSERVER_EXPORT -Ibin/pack