Skip to content

Instantly share code, notes, and snippets.

View artm's full-sized avatar

Artem Baguinski artm

  • Performation B.V.
  • Emmen, NL
  • 10:26 (UTC +02:00)
View GitHub Profile
@artm
artm / PointLib.cginc
Created June 25, 2011 09:49
Manual Billboarding
// Shift a billboard corner size pixels along its corner
inline void Billboard(inout float4 pos, in float2 corner, float size)
{
pos.xy += (size * 2.0 / _ScreenParams.xy) * corner * pos.w;
}
// structures used to pass input output between shader stages
struct PointVIn {
float4 vertex : POSITION;
float4 texcoord : TEXCOORD;
@artm
artm / opencv-ffmpeg-0.8.patch
Created June 25, 2011 18:17
building OpenCV-2.3 against ffmpeg-0.8 (both their latest stable)
diff --git a/modules/highgui/src/cap_ffmpeg.cpp b/modules/highgui/src/cap_ffmpeg.cpp
index ec44548..9c48f96 100644
--- a/modules/highgui/src/cap_ffmpeg.cpp
+++ b/modules/highgui/src/cap_ffmpeg.cpp
@@ -468,7 +468,7 @@ bool CvCapture_FFMPEG::open( const char* _filename )
AVCodecContext *enc = &ic->streams[i]->codec;
#endif
- if( CODEC_TYPE_VIDEO == enc->codec_type && video_stream < 0) {
+ if( AVMEDIA_TYPE_VIDEO == enc->codec_type && video_stream < 0) {
@artm
artm / brew-install.patch
Created July 5, 2011 16:39
Brew compliant install target for mpeg_stat
diff --git a/Makefile b/Makefile
index 48aedd1..a6c5be2 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ CFLAGS = $(DEBUGFLAG) $(INCLUDEDIR)
# for SunOS cc, just use the above
# for cc on HPUX:
-HP-CC-FLAGS = -Aa $(CFLAGS) -D_HPUX_SOURCE -DBSD -DNONANSI_INCLUDES
+# HP-CC-FLAGS = -Aa $(CFLAGS) -D_HPUX_SOURCE -DBSD -DNONANSI_INCLUDES
@artm
artm / groupwrap.rb
Created March 10, 2012 21:35
Subpattern wrapper
class GroupWrap
def initialize(&block)
@wrap = block
@transformers = []
end
def handle(pattern, *tags)
@transformers << [pattern, *tags]
end
@artm
artm / shorter
Created March 15, 2012 15:34 — forked from pita5/gist:2044780
template.gsub!('{{CONNECT_MEETING_099}}', delegate[12] || '')
set viminfo=!,'100,<50,s10,h
au VimLeavePre * let g:BG = &background
au VimEnter * if exists("g:BG") | let &background = g:BG | endif
@artm
artm / bg.rb
Created March 20, 2012 15:28
fail in bg the second time around
Given /^I puts "([^"]*)"$/ do |arg1|
if !$ran
puts arg1
$ran = arg1 == 'fg1'
else
true.should == false
end
end
@artm
artm / psych-gc.rb
Created April 17, 2012 12:06
psych object_id confusion
require 'psych'
require 'yaml'
class General
def gen
# this amount was found expetimentally and exposes the problem eventually on my machine
(1...2000).map do |x|
Float(x)
end
end
@artm
artm / fixup.rb
Created September 7, 2012 18:34
"fix up" osx application bundles
require "fileutils"
class BundleFixer
def initialize(bundle)
@bundle_dir = bundle.sub(%r{/$},"")
raise "No such bundle #{bundle}" unless File.directory? @bundle_dir
basename = File.basename(@bundle_dir, ".app")
@embed_dir = "#{@bundle_dir}/Contents/Frameworks"
@embed_rel_dir = "@executable_path/../Frameworks"
@artm
artm / ruby-backtrace.txt
Created November 9, 2012 11:18
Middleman server crash
Process: ruby [15955]
Path: /Users/artm/.rbenv/versions/1.9.3-p194/bin/ruby
Identifier: ruby
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: bash [25775]
Date/Time: 2012-11-09 11:45:01.335 +0100
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6