Skip to content

Instantly share code, notes, and snippets.

@nathanpc
nathanpc / ndi-tools.md
Last active Jun 11, 2022
NDI Tools Direct Links for Download
View ndi-tools.md
@nathanpc
nathanpc / RenderCameraSwitcher.cs
Created Jun 7, 2022
Switch Unity Render Camera for Video Mapping
View RenderCameraSwitcher.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Switches the camera automatically depending on the scene required.
/// </summary>
public class RenderCameraSwitcher : MonoBehaviour {
public RenderTexture renderTexture;
protected Camera lastCamera;
View TextureTransformation.shader
// TextureTransformation.shader
// A simple shader that allows us to transition between two textures from a script.
//
// Author: Nathan Campos <nathan@innoveworkshop.com>
Shader "Custom/TextureTransformation" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Original Texture", 2D) = "white" {}
_TransTex("Transformed Texture", 2D) = "gray" {}
@nathanpc
nathanpc / MintyUSBoost.c
Created Feb 19, 2016
A minimalistic switchmode converter
View MintyUSBoost.c
/*
* File: MintyUSBoost.c
* Author: Nathan Campos <nathanpc@dreamintech.net>
*
* Created on February 14, 2016, 2:45 PM
*/
// 12F683
// +---------+
// -|Vdd Vss|-
@nathanpc
nathanpc / ascii_bin.asm
Created Jun 18, 2011
Convert ASCII To Binary
View ascii_bin.asm
#make_COM#
; COM file is loaded at CS:0100h
org 10h
; ********************************
; * Program: ASCIICONV.ASM *
; ********************************
include 'emu8086.inc'
@nathanpc
nathanpc / phonegap_download_example.html
Created Apr 22, 2012
Sample code to download file from internet - Phonegap Wiki
View phonegap_download_example.html
<!DOCTYPE html>
<html>
<head>
<title></title>
<!-- Android
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta charset="utf-8">-->
<!-- iPad/iPhone specific css below, add after your main css >
@nathanpc
nathanpc / Ruby-StyleGuide.md
Last active Sep 21, 2018
Ruby Style Guide (Innove Workshop Company)
View Ruby-StyleGuide.md

Ruby Style Guide

This style guide is based on the one used by GitHub, but with some changes that make the code a tiny bit more readable.

  • Use soft-tabs with a two space indent.

  • Keep each line of code to a readable length. Unless you have a reason to, keep lines to fewer than 100 characters.

  • Never leave trailing whitespace.

@nathanpc
nathanpc / irc_client.cpp
Last active Dec 11, 2015
Fix for the QUIT bug in leafIRC
View irc_client.cpp
void *IRC_Client::handle_recv(void) {
// recv some data.
int numbytes;
char buffer[MAXDATASIZE];
while (true) {
numbytes = recv(socket_descriptor, buffer, MAXDATASIZE - 1, 0);
buffer[numbytes] = '\0';
if (numbytes == 0) {
@nathanpc
nathanpc / BBTimer.java
Created Jun 23, 2012
Timers on BlackBerry Java
View BBTimer.java
Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
// Do something when the timer ticks
}
});
}