Skip to content

Instantly share code, notes, and snippets.

View nitz's full-sized avatar
less bitter more glitter

Chris Dailey nitz

less bitter more glitter
View GitHub Profile
@nitz
nitz / keybase_proof.md
Created July 2, 2015 18:32
Keybase Proof

Keybase proof

I hereby claim:

  • I am nitz on github.
  • I am cmd (https://keybase.io/cmd) on keybase.
  • I have a public key whose fingerprint is 0219 59C4 ED7E AF7A DEA1 16FB DAB2 C9E0 E926 E40D

To claim this, I am signing this object:

@nitz
nitz / gist:dd5189a6032cce17516268388f732b1d
Created September 13, 2016 18:08 — forked from AnnaCrumina/gist:71c837eab6e30538dd19
Smooth scroll for anchor links
<script>
jQuery('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') || location.hostname == this.hostname) {
var target = jQuery(this.hash);
target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']');
if (target.length) {
var top_offset = '100';
jQuery('html,body').animate({
scrollTop: target.offset().top - top_offset
@nitz
nitz / wild_magic.js
Created December 2, 2017 20:40
Create Wild Magic Surge rollable table in Roll20.
/* Wild Magic Surge table generator by tobloef
Paste this into your browser's developer console (F12)
The script will create a rollable table named "Wild Magic Surge" with all 50 possibilities.
You can of course use this script to create other rollable tables, all you have to do is to replace the values in the rows variable.
You can also define a weight for each possibility by including a weight property like this:
{ name: "Some name here", weight: 2 }
Enjoy!
@nitz
nitz / Easing.cs
Last active November 2, 2020 02:20 — forked from xanathar/Easing.cs
Robert Penner's easing equations for Unity
/**
* Easing
* Animates the value of a float property between two target values using
* Robert Penner's easing equations for interpolation over a specified Duration.
*
* Original Author: Darren David darren-code@lookorfeel.com
*
* Ported to be easily used in Unity by Marco Mastropaolo
*
* Credit/Thanks:
@nitz
nitz / JS-LINQ.js
Last active January 22, 2020 12:50 — forked from DanDiplo/JS-LINQ.js
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
{ name: "Judy", age: 42 },
{ name: "Tim", age: 8 }
@nitz
nitz / tmate-daemon.sh
Created November 4, 2020 20:34 — forked from 89luca89/tmate-daemon.sh
Simple daemon to use tmate to control a remote machine behind NAT. Uses tmate to generate sessions and save them in a cloud-sync provider folder (ex Dropbox or GDrive)
#!/bin/bash
IP=$(ip a s wlp3s0 | grep inet | awk '{print $2}' | head -n 1)
while true; do
ping -q -w 1 -c 1 `ip r | grep default | awk '{print $3}'` > /dev/null
# No internet connection
if (( $? != 0 )); then
sleep 20s
ping -q -w 1 -c 1 `ip r | grep default | awk '{print $3}'` > /dev/null
if (( $? != 0 )); then
@nitz
nitz / tmate_for_ssh.md
Created November 4, 2020 20:34 — forked from iskolbin/tmate_for_ssh.md
Ubuntu(systemd) tmate service for ssh

The motivation is: ssh to remote computer without port forwading, dynamic DNS and so on, the only thing needed is that the remote is connected to the Internet.

  1. On remote get tmate, put it in /usr/local/bin (apt version as of 18.04LTS is too old):
curl -L https://github.com/tmate-io/tmate/releases/download/2.4.0/tmate-2.4.0-static-linux-amd64.tar.xz|tar xJv
sudo mv tmate-2.4.0-static-linux-amd/tmate /usr/local/bin
  1. Put public keys in ~/.ssh/authorized_keys
@nitz
nitz / whh.Xresources
Last active November 4, 2021 14:51
witch-hazel-hypercolor
! special
*.foreground: #e5e5c8
*.background: #433f55
*.cursorColor: #e5e5c8
! black
*.color0: #282634
*.color8: #716898
! red
#!/bin/sh
sleep .1; printf "⣽⣩⣺⣻⣾⣺⣻⣿⣿⡿⠟⠙⠀⢀⣀⡀⠀⢀⣠⣨⣨⣨⣼⣿⣿⣿⣿⣿⣿⣿⣿⣸⠀⠀
⣿⣿⣿⣿⣿⣿⣿[4
@nitz
nitz / EntitlementsPostprocessStep.cs
Created September 20, 2021 14:33
Unity iOS com.apple.developer.networking.multicast entitlement plist generation.
// SPDX-FileCopyrightText: © 2021 Chris Marc Dailey (nitz)
// SPDX-License-Identifier: MIT
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using UnityEngine;
public class EntitlementsPostprocessStep : MonoBehaviour