Skip to content

Instantly share code, notes, and snippets.

View wedesoft's full-sized avatar

Jan Wedekind wedesoft

View GitHub Profile
@wedesoft
wedesoft / grid.rb
Created September 26, 2011 00:02
Chequerboard Corner Detection
require 'rubygems'
require 'hornetseye_ffmpeg'
require 'hornetseye_xorg'
include Hornetseye
class Node
def nms(threshold)
self >= dilate.major(threshold)
end
def have(n, corners)
hist = mask(corners).histogram max + 1
@wedesoft
wedesoft / INSTALL
Created November 18, 2011 15:36
Installation information for hornetseye-kinect, hornetseye-xorg, and hornetseye-frame, multiarray, and malloc on Mac OS X
Regarding the installation, the Ruby Gems hornetseye-kinect,
hornetseye-frame, multiarray, and malloc are required [1]. It is also
recommended to install hornetseye-xorg for displaying windows with Ruby.
XCode and Ruby already were installed. There was an issue with Rubygems
though [2].
One needs to install MacPorts [3] and configure it to build universal
binaries [4].
[5] explains how to install git, cmake, and libfreenect. Note that you
need to build universal binaries of libfreenect according to [6]. Also libfreenect
requires the jpeg libraries to be installed:
@wedesoft
wedesoft / clipboard.rb
Created July 27, 2012 14:12
Qt4 Clipboard
#!/usr/bin/env ruby
require 'rubygems'
require 'Qt4'
class Test < Qt::Widget
def keyPressEvent(e)
if e.modifiers == Qt::ControlModifier
mimeData = $qApp.clipboard.mimeData
case e.key
when Qt::Key_C
puts 'copy!'
@wedesoft
wedesoft / file_reference_url.mm
Created July 31, 2012 11:20
Convert weird Mac OS file reference URL to a POSIX path
#import <Foundation/Foundation.h>
#import <Foundation/NSUrl.h>
#import <Foundation/NSString.h>
// file_reference_url.mm: convert weird Mac OS file reference URL to a file URL
// Compilation:
// gcc -o file_reference_url file_reference_url.mm -framework Cocoa
// Example:
// ./file_reference_url file:///.file/id=6571367.15106761
@wedesoft
wedesoft / hello-qt.lisp
Last active February 5, 2017 12:37
Small GUI example using Steel Bank Common Lisp, Quicklisp, CommonQt, and Qt4.
#!/usr/bin/sbcl --script
; Also see http://pleasegodno.wordpress.com/common-lisp-tutorials/common-lisp-gui-programming-with-commonqt/introduction-to-commonqt/
; or see http://kvardek-du.kerno.org/2011/12/setting-up-commonqt-on-osx.html if you're still using Mac OS
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
(user-homedir-pathname))))
(when (probe-file quicklisp-init)
(load quicklisp-init)))
@wedesoft
wedesoft / figshare.rb
Last active December 18, 2015 21:39
Get application access token and upload file to FigShare.com
#!/usr/bin/env ruby
require 'net/http'
require 'net/http/post/multipart'
require 'mime/types'
require 'oauth'
require 'json'
require 'yaml'
require 'launchy'
AUTH_FILE = 'figshare.yaml'
@wedesoft
wedesoft / AddToPath.nsh
Last active December 22, 2015 16:09
NSIS script for creating Qt4-QtRuby installer
;----------------------------------------
; based upon a script of "Written by KiCHiK 2003-01-18 05:57:02"
;----------------------------------------
!verbose 3
!include "WinMessages.NSH"
!verbose 4
;====================================================
; get_NT_environment
; Returns: the selected environment
; Output : head of the stack
@wedesoft
wedesoft / heisttest.rb
Last active December 29, 2015 13:08
Playing around with the Heist Ruby Gem.
#!/usr/bin/env ruby
require 'heist'
# true
scheme = Heist::Runtime.new
# #<runtime: call/cc disabled, hygienic, eager>
def test x
puts "\# #{x.class}: #{x}"
x
end
# nil
@wedesoft
wedesoft / .gitignore
Last active December 30, 2015 03:28
Bounded Hough Transform
*.png
*.avi
.*.un~
.*.swp
@wedesoft
wedesoft / .gitignore
Last active July 28, 2020 19:00
Embed Racket interpreter
embed
base.c
.*.un~
*.3m.c
*.o