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 / fsm.c
Created March 24, 2022 17:26 — forked from ankurs/fsm.c
FSM in C
/**
* @file fsm.c
* @brief an implementation for a FSM in C, this file contains
* implementation of definations.
* License GPLv3+
* @author Ankur Shrivastava
*/
#include "fsm.h"
#include<stdlib.h>
@nitz
nitz / victor-mono.css
Created November 3, 2021 20:56 — forked from pyrho/victor-mono.css
A font file for Blink Shell with the Victor Mono font
@font-face {
font-family: "VictorMono Nerd Font";
font-style: normal;
font-weight: 200;
src: url(https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/VictorMono/Light/complete/Victor%20Mono%20Light%20Nerd%20Font%20Complete%20Mono.ttf?raw=true);
}
@font-face {
font-family: "VictorMono Nerd Font";
font-style: normal;
font-weight: 400;
@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 / 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 / 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 / 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 / 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 / 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