Skip to content

Instantly share code, notes, and snippets.

#Modified from https://gist.github.com/larsks/4011808
#Waits forever if $tries is not > 0
function Wait-ForNetwork () {
param(
[int]$tries
)
$try = 0
while (1) {
# Get a list of interfaces
$z = gwmi -class Win32_NetworkAdapterConfiguration;
@Andersama
Andersama / consoletest.js
Last active July 23, 2023 10:09
Example OBS animation using the browser plugin
/*Copy/Paste this into console to manually trigger events (to test animation in broswer)*/
/*See: https://stackoverflow.com/questions/2490825/how-to-trigger-event-in-javascript */
var event;
var evtName = "obsStreamingStarted";
if (document.createEvent) {
event = document.createEvent("HTMLEvents");
event.initEvent(evtName, true, true);
} else {
event = document.createEventObject();
event.eventType = evtName;
/*Takes an array of hh:mm:ss formatted text and returns a floating point value where 1.0 represents a full day*/
function durationToFloat(durations){
return durations.map(function(t){
/*hh:mm:ss*/
var segments = t.split(":");
//24:60:60
//24:1440:86400
return (parseInt(segments[0],10) / 24) + (parseInt(segments[1],10) / (1440) ) + (parseInt(segments[2],10) / (86400));
});
}
/* Some neat resources */
/* radix sort from: https://www.geeksforgeeks.org/radix-sort/*/
/* radix sort from: https://github.com/gorset/radix/blob/master/radix.cc*/
/* radix sort from: https://www.quora.com/What-is-the-most-efficient-way-to-sort-a-million-32-bit-integers*/
/* radix sort from: http://pseudoprogrammer.blogspot.com/2012/05/binary-radix-sort.html*/
/*// the template
void radix_sort(unsigned *begin, unsigned *end)
{
unsigned *begin1 = new unsigned[end - begin];
unsigned *end1 = begin1 + (end - begin);
uniform float4x4 ViewProj;
uniform texture2d image;
uniform texture2d image_1;
uniform texture2d image_2;
uniform texture2d image_3;
uniform texture2d image_4;
uniform texture2d image_5;
uniform texture2d image_6;
uniform texture2d image_7;
uniform float4x4 ViewProj;
uniform texture2d a_tex;
uniform texture2d b_tex;
uniform texture2d c_tex;
uniform float4 color_target_a;
uniform float4 color_target_b;
uniform bool invert;
sampler_state textureSampler {
Filter = Linear;
uniform float4x4 ViewProj;
uniform texture2d image;
uniform float2 elapsed_time;
uniform float2 uv_offset;
uniform float2 uv_scale;
uniform float2 uv_pixel_interval;
sampler_state textureSampler {
Filter = Linear;
uniform float4x4 ViewProj;
//this pulls in the texture from render target 1
uniform texture2d image;
//assuming the pattern followed~
uniform texture2d image_2;
uniform texture2d image_3;
uniform float2 elapsed_time;
uniform float2 uv_offset;
uniform float2 uv_scale;
uniform float4x4 ViewProj;
uniform texture2d image;
uniform float elapsed_time;
uniform float2 uv_offset;
uniform float2 uv_scale;
uniform float2 uv_pixel_interval;
sampler_state textureSampler {
Filter = Linear;
uniform float4x4 ViewProj;
uniform texture2d image;
uniform float elapsed_time;
uniform float2 uv_offset;
uniform float2 uv_scale;
uniform float2 uv_pixel_interval;
sampler_state textureSampler {
Filter = Linear;