This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Name of the device in pactl, use the following to discover names | |
# pactl list sources | grep -e 'Name' -e 'Description' | |
steel_series='alsa_input.usb-SteelSeries_Arctis_Pro_Wireless-00.analog-mono' | |
snowball='alsa_input.usb-BLUE_MICROPHONE_Blue_Snowball_201712-00.analog-stereo' | |
# Get the active source, ideally would use 'pactl get-default-source', | |
# but that isn't supported in my version of pulseaudio, | |
# Should be noted that this work around may break if there are multiple sources that are being used |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def incr (rand): | |
return [rand[1], rand[2], rand[3] ^ rand[0], rand[4], rand[5], rand[6], rand[7], rand[8] ^ rand[0], rand[0]] | |
# Check if the last combination equals the seed/starting combination | |
def equal(a, b): | |
for i in range(len(a)): | |
if a[i] != b[i]: | |
return False | |
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Uses Coroutines & LateUpdate to do processing over a larger percentage of the game loop | |
//Uses WaitForEndOfFrame (called after rending before next frame) instead of Update | |
// and LateUpdate (called before rendering) | |
// see: https://docs.unity3d.com/Manual/ExecutionOrder.html | |
using System.Collections; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using UnityEngine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let input = "1d6 + 2d8 + 5"; | |
//let rollEXP = /[^ ,.+]+/gi; | |
const rollEXP = /(?:[0-9]*d[0-9]+)|(?:[0-9]+)/gi; | |
let segments = input.match(rollEXP); | |
let max = new Array(segments.length); | |
let min = new Array(segments.length); | |
let avg = new Array(segments.length); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Uses Update & LateUpdate to synchronize background threads | |
//Uses Update (Called after physics updates) | |
// and LateUpdate (called before rendering) | |
// see: https://docs.unity3d.com/Manual/ExecutionOrder.html | |
using System.Threading; | |
using System.Threading.Tasks; | |
using UnityEngine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class Find4thPoint { | |
public Vector3 Find4th(Vector3 a, Vector3 b, Vector3 c) { | |
Vector3 point, cornerA, cornerB; | |
Vector3[] points = new Vector3[] {a, b, c}; | |
float angleDelta = 180; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Example Usage: | |
/* | |
const mines = require('./mines.js'); | |
let msg = mines(14,14,20,'X',true); | |
*/ | |
//X - Width | |
//Y - Height |