Skip to content

Instantly share code, notes, and snippets.


Drew Prentice weirdpercent

View GitHub Profile
weirdpercent / radium-build-error
Created Mar 7, 2015
Building Radium on Ubuntu 14
View radium-build-error
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 >../common/keyboard_sub_ids.h
bash `./` 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
weirdpercent / gist:566d99252d055be1c266
Created Oct 31, 2014
Error while updating rubysl-openssl
View gist:566d99252d055be1c266
/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
View gist:8be87bdbbcda24bb4a60
root_path = File.join(File.dirname(__FILE__), "../")
require 'lib/peas'
@api =
include GLI::App
reset # Used when this file is repetitively loaded by rspec
weirdpercent / search.rb
Created Apr 16, 2014
Using open-uri to fetch URLs with error-handling.
View search.rb
require 'multi_json'
require 'open-uri/cached'
def search(url, result)
OpenURI::Cache.cache_path = 'tmp/open-uri'
if status[0] == "200"
puts "HTTP Status #{status[0]} #{status[1]}"
View array.rb
{:arg_size=>0, :local_size=>3, :stack_max=>2},
weirdpercent / rdoc2md.rb
Created Mar 11, 2014
Convert rdoc to markdown
View rdoc2md.rb
require 'rdoc'
h =
puts h.convert(input_string)
View readme.markdown


Description: What does this project do and who does it serve?

Project Setup

How do I, as a developer, start working on the project?

  1. What dependencies does it have (where are they expressed) and how do I install them?
  2. How can I see the project working before I change anything?


At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.


View a_picky_static_site_search.rb
# Runs with Picky 3.3.1.
# Note: You need some example html files in
# the same directory.
# Index data and start:
# 1. rake index
# 2. ruby app.rb
# Then, search on it using:
weirdpercent / addjson.rake
Last active Dec 24, 2015
This rake task is part of the kvr-tools project. It parses product entries in JSON format into Active Record.
View addjson.rake
desc "Add product entries to database"
task :addjson => :environment do
require 'multi_json'
print 'Adding products to database'
Dir.glob('json/*.json').select {|f| fa.push f}
You can’t perform that action at this time.