Skip to content

Instantly share code, notes, and snippets.

View colindean's full-sized avatar
🏆
Helping others find happiness and serenity

Colin Dean colindean

🏆
Helping others find happiness and serenity
View GitHub Profile
@colindean
colindean / jruby-hash-array-problem.rb
Created November 14, 2011 18:03
Java converts the return of Hash#select to an array when using a JRuby warbled jar
#!/usr/bin/env ruby
#put this in ./bin/
#this should demonstrate that a ruby hash gets converted to an array when
#warbled
hashme = {'stringhash' => 'foo', :symbol_hash => 'sdfdf', 'nilvalue' => nil}
puts "Should be Hash: #{hashme.class.to_s}"
hashme = hashme.select {|k,v| !v.nil?}
@colindean
colindean / pyuvcdyncrtl.py
Created December 7, 2011 01:40
UVC Pan/Tilt control program for GTK in Python
#!/usr/bin/env python
########################################################
# Created by: Steve Cundy
# Date Modified: Jan 29, 2008
#
# Purpose: quick and dirty gui to control PTZ of my
# Logitech Quickcam Orbit AF (actually there is no zoom
# control :)
#
# To Do:
@colindean
colindean / lgs
Created May 24, 2012 04:10
rvm #974
[colin@bricktop ~]$ rvm --trace rvm list gemsets strings
+ /scripts/cli : __rvm_parse_args() 758 > [[ -n '' ]]
+ /scripts/cli : __rvm_parse_args() 759 > export 'PS4=+ ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
+ /scripts/cli : __rvm_parse_args() 759 > PS4='+ ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
+ /scripts/cli : __rvm_parse_args() 790 > [[ -z '' ]]
+ /scripts/cli : __rvm_parse_args() 790 > [[ -n '' ]]
+ /scripts/cli : __rvm_parse_args() 792 > [[ 0 -eq 1 ]]
+ /scripts/cli : __rvm_parse_args() 792 > [[ -n '' ]]
+ /scripts/cli : __rvm_parse_args() 13 > [[ -n rvm ]]
+ /scripts/cli : __rvm_parse_args() 15 > rvm_token=rvm
@colindean
colindean / btc_bid_ask.rb
Created July 13, 2012 04:27
Quickly shows the most reasonable USD lowest asker and highest bidder from bitcoincharts.com
#!/usr/bin/env ruby
require "open-uri"
require "json"
#get the data
j = JSON.parse open("http://bitcoincharts.com/t/markets.json").read
#only USD, only active exchanges, and only where there's a bid and ask
j.select! {|x| x["currency"] == "USD" and x["volume"] > 0 and !x["ask"].nil? and !x["bid"].nil?}
#sort, need lowest ask and highest bidder
ask = j.sort {|x,y| x["ask"] <=> y["ask"]}
bid = j.sort {|x,y| x["bid"] <=> y["bid"]}
@colindean
colindean / output.txt
Created July 29, 2012 19:27
compilation error on OSX 10.8
[colin@kid application]$ sh 1.regen_all.sh
Scanning directory '../GUI'...
Scanning directory '../Common/RemoteCoreController'...
Updating 'd_lan_gui.fr.ts'...
Found 174 source text(s) (0 new and 174 already existing)
Scanning directory '../Core'...
Updating 'd_lan_core.fr.ts'...
Found 10 source text(s) (0 new and 10 already existing)
mkdir: ../GUI/output: File exists
mkdir: ../GUI/output/debug: File exists
@colindean
colindean / output.txt
Created July 29, 2012 20:15
D-LAN compilation attempt on 10.8 with stdlib=libc++ removed
16:12:21: Running build steps for project Core...
16:12:21: Configuration unchanged, skipping qmake step.
16:12:21: Starting: "/usr/bin/make" -f Makefile-Core -w
make: Entering directory `/Users/colin/Source/D-LAN/application'
cd Common/ && /usr/bin/make -f Makefile-Core
make[1]: Entering directory `/Users/colin/Source/D-LAN/application/Common'
/Users/colin/Source/QtSDK/Desktop/Qt/4.8.1/gcc/bin/qmake -spec ../../../QtSDK/Desktop/Qt/4.8.1/gcc/mkspecs/unsupported/macx-clang CONFIG+=declarative_debug -o Makefile-Core Common.pro
make[1]: Leaving directory `/Users/colin/Source/D-LAN/application/Common'
make[1]: Entering directory `/Users/colin/Source/D-LAN/application/Common'
clang++ -c -pipe -std=c++11 -std=c++0x -g -gdwarf-2 -arch x86_64 -fPIC -Wall -Wno-parentheses -DDEBUG -DCOMMON_LIBRARY -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../QtSDK/Desktop/Qt/4.8.1/gcc/mkspecs/unsupported/macx-clang -I. -I../../../QtSDK/Desktop/Qt/4.8.1/gcc/lib/QtCore.framework/Versions/4/Headers -I../../../QtSDK/Desktop/Qt/4.
@colindean
colindean / make.txt
Created August 31, 2012 00:35
Compiling D-LAN on OSX 10.8.1
OSX 10.8.1
QtCreator 4.8.2
Qt 5.0.0-beta1
20:34:44: Running steps for project Core...
20:34:44: Starting: "/Users/colin/Source/Qt5.0.0beta1/Desktop/Qt/5.0.0-beta1/gcc_64/bin/qmake" /Users/colin/Source/D-LAN/application/Core.pro -r -spec macx-clang CONFIG+=x86_64 CONFIG+=declarative_debug
Project WARNING: CONFIG+=declarative_debug is deprecated. Use qml_debug or quick1_debug instead!
Reading /Users/colin/Source/D-LAN/application/Common/Common.pro
Project WARNING: CONFIG+=declarative_debug is deprecated. Use qml_debug or quick1_debug instead!
@colindean
colindean / script.txt
Created November 30, 2012 01:38
more gdb on picocoin
(gdb) break neteng_start
Breakpoint 9 at 0x100002294: file net.c, line 864.
(gdb) run netsync
Starting program: /Users/colin/Source/picocoin/src/picocoin netsync
Reading symbols for shared libraries . done
Breakpoint 9, neteng_start (neteng=0x10020f340) at net.c:864
864 if (neteng->running)
(gdb) s
867 if (pipe(neteng->rx_pipefd) < 0)
@colindean
colindean / build-osx.md
Created December 12, 2012 16:08
updated from @gavinandresen's edits/additions, with some formatting and other fixes
@colindean
colindean / asus_wired-wired_tcp_client.txt
Created December 21, 2012 05:29
ASUS RT-N66U iperf benchmarks, comparison with Buffalo WZR-HP-AG300H
iperf -c marle.local -P 1 -i 1 -p 5001 -f m -t 10
------------------------------------------------------------
Client connecting to marle.local, TCP port 5001
TCP window size: 0.13 MByte (default)
------------------------------------------------------------
[ 5] local 192.168.1.132 port 65055 connected with 192.168.1.160 port 5001
[ ID] Interval Transfer Bandwidth
[ 5] 0.0- 1.0 sec 112 MBytes 940 Mbits/sec
[ 5] 1.0- 2.0 sec 112 MBytes 936 Mbits/sec
[ 5] 2.0- 3.0 sec 112 MBytes 935 Mbits/sec