Skip to content

Instantly share code, notes, and snippets.

//Attach to player object
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;
public class Voice : NetworkBehaviour
{
int lastSample;
AudioClip c;
@JohnAtl
JohnAtl / check-nvidia-cuda
Created January 5, 2024 15:25
Distrobox with Tensorflow and Nvidia support
#!/bin/bash
# Adapted from https://stackoverflow.com/a/47436840
function lib_installed() { /sbin/ldconfig -N -v $(sed 's/:/ /' <<< $LD_LIBRARY_PATH) 2>/dev/null | grep $1; }
function check() { lib_installed $1 && echo "$1 is installed" || echo -e "\nERROR: $1 is NOT installed\n"; }
check libcuda.so
check libcudart
check libcudnn
@brittonhayes
brittonhayes / kali_setup.sh
Last active May 4, 2024 02:21
Setup a new Kali Linux machine with my favorite flavors
#!/bin/bash
echo "GETTING STARTED..."
# Go Home
cd ~
# Create code environment
mkdir -p ~/Documents/code/workspace
mkdir -p ~/Documents/code/scripts
@ncalm
ncalm / excel-lambda-FREQ.SIMPLE.txt
Last active May 4, 2024 02:19
This Excel lambda function creates a simple frequency table for a single-column array
/*
FREQ.SIMPLE
Calculates a simple frequency table of the values in a column
Inputs:
1. data - a single column of data
*/
FREQ.SIMPLE = LAMBDA(data,
@ncalm
ncalm / excel-lambda-CORRELMATRIX.txt
Created June 1, 2022 18:28
This Excel lambda function calculates a correlation matrix for a range of data, optionally using either the Pearson or Spearman Ranked correlation
/*
CORRELMATRIX
Returns a correlation matrix
Inputs:
x - an array of 2:n numeric columns of equal size for which to calculate the correlation of each pair of 2 columns
has_header - TRUE if the first row of x contains column headers. If omitted or FALSE, x is assumed to not include a header row
ranked - if TRUE, calculate the Spearman Ranked Correlation Coefficient. If FALSE or omitted, calculate the Pearson Correlation Coefficient
*/
@odan
odan / nginx-php-windows-setup.md
Last active May 4, 2024 02:16
Nginx and PHP Setup on Windows

Nginx and PHP Setup on Windows

For local development you could also use Nginx with PHP as an replacement for XAMPP.

Install Nginx

@igv
igv / adaptive-sharpen.glsl
Last active May 4, 2024 02:13
Optimal sharpening strength (according to objective metrics) - 0.5. Can be applied only to luma channel (change OUTPUT to LUMA). To use it on-demand add the following line to input.conf: n change-list glsl-shaders toggle "~~/adaptive-sharpen.glsl"
// Copyright (c) 2015-2021, bacondither
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer
// in this position and unchanged.
// 2. Redistributions in binary form must reproduce the above copyright
@ole
ole / set-photos-keyboard-shortcuts.sh
Last active May 4, 2024 02:10
Assign a keyboard shortcut to the Export Unmodified Originals menu command in Photos.app on macOS
#!/bin/bash
# Assigns a keyboard shortcut to the Export Unmodified Originals
# menu command in Photos.app on macOS.
# @ = Command
# ^ = Control
# ~ = Option
# $ = Shift
shortcut='@~^e'
@bejaneps
bejaneps / websites.csv
Created August 28, 2020 18:09
List of top 1000 websites
1 fonts.googleapis.com 10
2 facebook.com 10
3 twitter.com 10
4 google.com 10
5 youtube.com 10
6 s.w.org 10
7 instagram.com 10
8 googletagmanager.com 10
9 linkedin.com 10
10 ajax.googleapis.com 10