Skip to content

Instantly share code, notes, and snippets.

@nathanpc
nathanpc / settings.json
Created October 1, 2022 14:27
Windows Terminal Settings
View settings.json
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command": "find",
"keys": "ctrl+shift+f"
},
{
@nathanpc
nathanpc / open-close.js
Created August 25, 2022 12:45
Simple store open/closed indicator
View open-close.js
/**
* open-close.js
* Dynamic display of a store open state.
*
* @author Nathan Campos <nathan@innoveworkshop.com>
*/
// ==== Week Day Codes ====
// Domingo 0
// Segunda 1
@nathanpc
nathanpc / RenderCameraSwitcher.cs
Created June 7, 2022 00:15
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;
@nathanpc
nathanpc / TextureTransformation.shader
Created June 6, 2022 12:28
Transform Textures in Unity
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 / ndi-tools.md
Last active June 11, 2022 10:20
NDI Tools Direct Links for Download
View ndi-tools.md
@nathanpc
nathanpc / Ruby-StyleGuide.md
Last active September 21, 2018 21:03
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 / MintyUSBoost.c
Created February 19, 2016 13:16
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 / linear_vreg_res.R
Last active August 29, 2015 14:12
Calculates the resistor values to be used in a op-amp based linear voltage regulator according to a specific selection of voltage references.
View linear_vreg_res.R
#' linear_vreg_res.R
#' Calculates the resistor values to be used in a op-amp based linear voltage
#' regulator according to a specific selection of voltage references.
#'
#' @author Nathan Campos <nathanpc@dreamintech.net>
# Generates a E12 series of resistors.
e12_resistors <- function (steps = c(1000, 10000, 100000)) {
base = c(1.0, 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8, 8.2)
e12 = c()
@nathanpc
nathanpc / plot_thd.py
Last active August 29, 2015 14:05
THD Plotting Script
View plot_thd.py
#!/bin/env python
### plot_thd.py
### Plot the THD of a circuit over a range of frequencies using ngspice.
###
### Author: Nathan Campos <nathanpc@dreamintech.net>
import os
import sys
import subprocess
@nathanpc
nathanpc / .screenrc
Last active August 29, 2015 14:02
My .screenrc
View .screenrc
# Autodetach session on hangup instead of terminating screen completely
autodetach on
# Set the colors to 256 and enable bold.
term screen-256color
attrcolor b ".I"
# 30.000-line scrollback buffer.
defscrollback 30000