Skip to content

Instantly share code, notes, and snippets.

View useafterfree's full-sized avatar
🤘
Please add pointing to projects, tx

Nathan Trujillo useafterfree

🤘
Please add pointing to projects, tx
View GitHub Profile
#include <Arduino.h>
#include <FastLED.h>
FASTLED_USING_NAMESPACE
#define LED_TYPE APA102
#define COLOR_ORDER GBR
#define NUM_LEDS 288
CRGB leds[NUM_LEDS];
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 29
#define DATA_PIN A9 // A9 // 23
#define MAX_BRIGHTNESS 255 // 64 - 255 is acceptable
// Lightning stuff
@useafterfree
useafterfree / realtimeMouse.reg
Created June 17, 2022 20:37
Registry setting to set winlogon.exe to the highest priority
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\winlogon.exe\PerfOptions]
"CpuPriorityClass"=dword:00000003
@useafterfree
useafterfree / realtimeMouse.ps1
Created June 17, 2022 20:33
Powershell script to set Real time mouse input WIN10/WIN11
param([switch]$Elevated)
function Test-Admin {
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
if ((Test-Admin) -eq $false) {
if ($elevated) {
# tried to elevate, did not work, aborting
#! /bin/bash
sudo apt-get update
sudo apt-get install openssh-server -y
sudo usermod -aG sudo ${USER}
sudo apt install nvidia-cuda-toolkit -y
sudo ubuntu-drivers autoinstall
sudo apt update
sudo apt-get install nvidia-utils-510 -y
## sudo vi /lib/modprobe.d/nvidia-graphics-drivers.conf
LINUX_VERSION=5.9-rc7
LINUX_KERNEL_VERSION=mainline-${LINUX_VERSION}
ZFS_VERSION=0.8.6
# Find ROOT_DIR
ROOT_DIR=/c
if [ ! -z "$(ls -A /mnt/c)" ]; then
ROOT_DIR=/mnt/c
fi
let textNodesUnder = (el) => {
var n, a=[], walk=document.createTreeWalker(el, NodeFilter.SHOW_TEXT, null, false);
while(n = walk.nextNode() ) a.push(n);
return a;
}
let makeProjectLink = (dev) => `https://github.com/itrvl/itrvl/issues/${dev.replace(/[^0-9]+/mg, '')}`;
let makeProjectLinks = (line) => {
let projectLinks = line.match(/\[dev-([0-9]+)\]/igm);
projectLinks && projectLinks.map((devLink) => {
let link = makeProjectLink(devLink);
let textNodesUnder = (el) => {
var n, a=[], walk=document.createTree
while(n = walk.nextNode() ) a.push(n)
return a;
}
let makeProjectLink = (dev) => `https:/
let makeProjectLinks = (line) => {
let projectLinks = line.match(/\[dev-
projectLinks && projectLinks.map((dev
let link = makeProjectLink(devLink)
import randomNumber from 'random-number-csprng';
import Hashids from 'hashids';
const range = 1000000;
const salty = 'SaltyMcSaltFace'
export const generateSaltedHash = async (number = Date.now(), salt = salty, len = 8) => {
const Hash = new Hashids(salt, len);
const prn = await randomNumber(-1 * range, range);
return Hash.encode(number, Math.abs(prn));
using UnityEngine;
using System.Collections;
public class TextureLooper : MonoBehaviour
{
//An array of Objects that stores the results of the Resources.LoadAll() method
private Object[] objects;
//Each returned object is converted to a Texture and stored in this array
private Texture[] textures;
//With this Material object, a reference to the game object Material can be stored