Skip to content

Instantly share code, notes, and snippets.

@luke161
luke161 / Singleton.cs
Last active May 11, 2024 22:05
Unity MonoBehaviour Singleton. Base class for creating a singleton in Unity, handles searching for an existing instance, useful if you've created the instance inside a scene. Also handles cleaning up of multiple singleton instances in Awake.
/**
* Singleton.cs
* Author: Luke Holland (http://lukeholland.me/)
*/
using UnityEngine;
public class Singleton<T> : MonoBehaviour where T : MonoBehaviour
{
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 11, 2024 22:03
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@Tras2
Tras2 / cloudflare-ddns-update.sh
Last active May 11, 2024 21:57
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record
@frjaraur
frjaraur / gist:7bad30cedc484486efd3ba5d12362bec
Created October 4, 2020 17:02
Libvirt-KVM create Bridge Interface using nmcli
### Show Active Interfaces
```
$ nmcli con show --active
```
### Create a Bridge Interface
```
$ nmcli con add ifname br0 type bridge con-name br0
Connection 'br0' (892869fe-f8ac-4f17-ace9-b8aeeeee61a0) successfully added.
```
@wklchris
wklchris / Remote-Jupyter-on-SSH-server.md
Last active May 11, 2024 21:49
Remote Jupyter Notebook via SSH

Main steps

Total 4 steps for connect & exit Jupyter Notebook with a SSH server:

  1. SSH to the Server. Run:
    jupyter notebook --no-browser --port=8888
  2. Open another terminal window on your local machine, input:
@pksunkara
pksunkara / config
Last active May 11, 2024 21:49
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@fdeitylink
fdeitylink / Bavi_H Notes URL.txt
Last active May 11, 2024 21:44
Organya FIle Format Specs
Original URL: http://rnhart.net/orgmaker/
Wayback Machine (in case site goes down): https://web.archive.org/web/20161204035709/http://rnhart.net/orgmaker/
@basham
basham / css-units-best-practices.md
Last active May 11, 2024 21:43
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@residentsummer
residentsummer / gostab.sh
Created February 25, 2017 16:15
Script to stabilize shaky GoPro footage with ffmpeg and libvidstab
#!/bin/bash
# Run without args to see usage
##### Configuration #####
# Maximum shakiness and accuracy
DETECT_OPTS="shakiness=10:accuracy=15"
# Fish-eye correction for GoPro H3+B 16:9 Wide
# http://stackoverflow.com/questions/30832248/is-there-a-way-to-remove-gopro-fisheye-using-ffmpeg/40659507#40659507