Skip to content

Instantly share code, notes, and snippets.

View smakhtin's full-sized avatar

Vadim Smakhtin smakhtin

View GitHub Profile
@smakhtin
smakhtin / vvvv.nodes.dshow9.js
Created July 9, 2012 20:22
FileStream DShow
// VVVV.js -- Visual Web Client Programming
// (c) 2011 Matthias Zauner
// VVVV.js is freely distributable under the MIT license.
// Additional authors of sub components are mentioned at the specific code locations.
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NODE: FileStream (DShow9)
Author(s): Vadim Smakhtin
@smakhtin
smakhtin / gist:3184521
Created July 26, 2012 21:08
Simple masking shader for VVVV
//@author: alg (Vadim Smakhtin)
//@help: masking with binary image. Black - alpha, white - visible.
//@tags: mask, alpha
//@credits:
// --------------------------------------------------------------------------------------------------
// PARAMETERS:
// --------------------------------------------------------------------------------------------------
//transforms
@smakhtin
smakhtin / myBookmarks.json
Created November 4, 2012 14:17
My bookmarks, exported to JSON for dl-110
[{
"children": [{
"children": [{
"dateAdded": 1327010826522,
"id": "4",
"index": 0,
"parentId": "1",
"title": "",
"url": "http://www.google.com/reader/view/#overview-page"
}, {
@smakhtin
smakhtin / vvvv_commands.sh
Created November 6, 2012 16:27
Start and stop bash commands for VVVV remoting via ssh
#Stop
ps -W | grep vvvv | awk '{print $1}' | xargs kill -f
#Start
/usr/local/bin/PsExec.exe -i 1 -s -d `cygpath -w /cygdrive/c/vvvv/vvvv_45beta28.1/vvvv.exe` /o `cygpath -w /cygdrive/c/vvvv/test.v4p`
@smakhtin
smakhtin / ConvertDate.js
Created November 16, 2012 21:33
Convert date from GMT to ISO 8601 format
function ISODateString(d) {
function pad(n){
return n<10 ? '0'+n : n
}
return d.getUTCFullYear()+'-'
+ pad(d.getUTCMonth()+1)+'-'
+ pad(d.getUTCDate())+'T'
+ pad(d.getUTCHours())+':'
+ pad(d.getUTCMinutes())+':'
+ pad(d.getUTCSeconds())+'Z'
@smakhtin
smakhtin / CoffeeScript.sublime-build
Created November 27, 2012 14:10
CoffeeScript_BuildConfig
{
"cmd": ["cake", "sbuild"]
, "path": "/usr/local/bin:$PATH"
, "selector": "source.coffee"
, "working_dir": "$project_path"
, "windows":
{
"cmd": ["cake.cmd", "sbuild"]
}
}
class @Sensocamera.ExternalSensor
START_ACTION = "start"
STOP_ACTION = "stop"
STATE_STOPPED = 0
STATE_STARTING = 1
STATE_RUNNING = 2
STATE_FAILED = 3
currentState = STATE_STOPPED
float x = DTid.x % Size.x;
float y = DTid.x / Size.y;
y = y - frac(y);
x /= Size.x;
y /= Size.y;
Output[DTid.x] = texture2d.SampleLevel(g_samLinear, float2(x, y), 0, 0);
@smakhtin
smakhtin / complex.hlsl
Created June 17, 2013 06:41
Working with complex numbers in hlsl
static const float pi = 3.14159265;
static const float e = 2.71828183;
float2 c_add(float2 c1, float2 c2)
{
float a = c1.x;
float b = c1.y;
float c = c2.x;
float d = c2.y;
return float2(a + c, b + d);
@smakhtin
smakhtin / gist:6417335
Last active October 15, 2021 07:39
Found good way to convert from and to HSV in HLSL. Source - http://ploobs.com.br/?p=1499.
float2 halfPixel;
float4 toAdd;
float4 toMultiply;
texture cena;
sampler cenaSampler = sampler_state
{
Texture = ;
MinFilter = LINEAR;
MagFilter = LINEAR;