Skip to content

Instantly share code, notes, and snippets.

@justinwiley
justinwiley / gist:9a6c59000949a1fcac3a
Last active August 29, 2015 14:25
msgpack exception
/Users/justinwiley/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/stuff-classifier-0.5/lib/stuff-classifier/storage.rb:67: [BUG] Bus Error at 0x0000010207f000
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
#lang racket/base
(require "remote.rkt")
; Everything up to this mark will be stripped and replaced
; for the embedded version.
; %%%END-OF-HEADER%%%
;----------------------------------------------------------------------------------
; Data that will be pre-cached before the first frame is rendered.
; The uri macro defines the name and adds a cache command to the init command list.
(uri WAV-ACTIVATE "http://s3.amazonaws.com/o.oculuscdn.com/netasset/wav/ui_object_activate_01.wav")
@justinwiley
justinwiley / gist:789e2f74a14cdb7814c4
Created December 4, 2014 21:15
arrayfire build w CMAKE_CXX_FLAGS
vagrant@vagrant-ubuntu-trusty-64:~/arrayfire/build$ free -m
total used free shared buffers cached
Mem: 238 53 184 0 3 12
-/+ buffers/cache: 37 200
Swap: 0 0 0
vagrant@vagrant-ubuntu-trusty-64:~/arrayfire/build$ make clean
vagrant@vagrant-ubuntu-trusty-64:~/arrayfire/build$ ls
arch.c CMakeCache.txt CMakeFiles cmake_install.cmake CTestTestfile.cmake examples gtest.patch install_manifest.txt Makefile src test third_party
vagrant@vagrant-ubuntu-trusty-64:~/arrayfire/build$ rm -rf ./*
vagrant@vagrant-ubuntu-trusty-64:~/arrayfire/build$ vi ../CMakeLists.txt
irb(main):020:0* class Foo
irb(main):021:1> def def_methods
irb(main):022:2> method_name = "meth-#{rand(1000)}"
irb(main):023:2> self.class.class_eval do
irb(main):024:3* define_method method_name do
irb(main):025:4* method_name.to_s.capitalize
irb(main):026:4> end
irb(main):027:3> end
irb(main):028:2> end
irb(main):029:1> end
@justinwiley
justinwiley / gist:4680507
Created January 31, 2013 05:29
Outcome, Response
Outcome
[0.14195468819753526, 0.1774433602469191, -0.07097734409876763, -0.1774433602469191, -0.14195468819753526, -0.14195468819753526, 0.1774433602469191, 0.10646601614815145, 0.07097734409876763, 0.07097734409876763, -0.1774433602469191, -0.1774433602469191, -0.10646601614815145, 0.10646601614815145, 0.07097734409876763, -0.07097734409876763, -0.07097734409876763, -0.10646601614815145, 0.07097734409876763, 0.14195468819753526, 0.035488672049383815, 0.07097734409876763, 0.1774433602469191, 0.035488672049383815, 0.07097734409876763, 0.0, 0.07097734409876763, 0.0, 0.035488672049383815, 0.07097734409876763, 0.035488672049383815, 0.14195468819753526, 0.1774433602469191, 0.1774433602469191, -0.035488672049383815, -0.035488672049383815, -0.10646601614815145, 0.1774433602469191, 0.14195468819753526, 0.07097734409876763, 0.10646601614815145, 0.10646601614815145, 0.10646601614815145, -0.10646601614815145, 0.10646601614815145, -0.07097734409876763, 0.07097734409876763, 0.10646601614815145, 0.0, 0.1774433602469191, -0
@justinwiley
justinwiley / gist:4074864
Created November 14, 2012 21:13
chef-client fails
jwiley@mix ~ (master)$ % chef-client -v
bash: fg: %: no such job
jwiley@mix ~ (master)$ sudo true && curl -L https://www.opscode.com/chef/install.sh | sudo bash
[sudo] password for jwiley:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6397 100 6397 0 0 23831 0 --:--:-- --:--:-- --:--:-- 34026
Downloading Chef for ubuntu...
Installing Chef
(Reading database ... 357980 files and directories currently installed.)
@justinwiley
justinwiley / cheap.js
Created April 25, 2012 20:41
A truly terrible way to prevent SQL injection
//validation for entering query
var notAllowed = ['select','SELECT','*','SeLeCt','sElEcT','{','}','(',')'];
for(var i = 0; i < notAllowed.length; i++){
if(document.frmSurvey.txtComments.value.indexOf(notAllowed[i]) != -1){
alert('The word "' + notAllowed[i] + '" is not allowed');
document.frmSurvey.txtComments.value = document.frmSurvey.txtComments.value.substr(0, document.frmSurvey.txtComments.value.indexOf(notAllowed[i]));
return false;
}
}
@justinwiley
justinwiley / dci-rest-creation.rb
Created January 26, 2012 19:46
DCI + Rails new and create
# ---role
module BookCreater
def create_book(attrs)
self.books.create! attrs
end
end
module BookUpdater
@justinwiley
justinwiley / gist:1616969
Created January 15, 2012 19:44
sample twilio
<?xml version="1.0" encoding="UTF-8" ?>
<Response>
<Pause length="1"/>
<Say voice="woman">
Thank you for calling about our survey regarding your recent U.N.C. ER experience.
If you would like to speak with someone directly, please contact UNC Patient Relations at (919) 966-5006
or visit our website at www. u.n.c. healthcare.org / health patient care. Have a nice day.
</Say>
<Pause length="1"/>
<Hangup/>
@justinwiley
justinwiley / ubuntu-rvm-pre-requisites.sh
Created January 10, 2012 20:01
Installing pre-requisites for successful rvm install under Ubuntu
# without having to resort to local rvm package install
sudo apt-get install build-essential zlib1g-dev libssl-dev libreadline6-dev libxml2-dev libsqlite3-dev libcurl4-openssl-dev;
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer );
rvm install ruby-1.9.3-p0