Skip to content

Instantly share code, notes, and snippets.

View vidia's full-sized avatar

David Tschida vidia

View GitHub Profile
vidia / nginx-unificontroller.conf
Last active May 6, 2024 12:41
Example, working, NGINX config for proxying to Unifi Controller software and using letsencrypt. Includes websocket fix.
# I had a bit of trouble getting my unifi controller (hosted offsite) to use a proxy/letsencrypt. So here are the fruits of my labor.
# The unifi default port is 8443 running on localhost.
# License: CC0 (Public Domain)
server {
# SSL configuration
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
private int getColorForNode(Node node) {
//Set the color of the node item.
if(node.getEdges().getIn().length <= 1 && node.getEdges().getOut().length <= 1) {
//This is either a green process or a yes/no question answer.
//we need to check the previous node to see what we are.
Node[] previousNodes = mAlgorithmGraph.getPreviousNodes(node);
if(previousNodes.length == 0) {
//this is the first node, so it has to be a process at this point.
return 0x8BCCA5;
vidia /
Created February 9, 2017 16:38
# This is a fork of that addresses issue #6.
function color (){
echo "\e[$1m$2\e[0m"
function extend (){
local str="$1"
let spaces=60-${#1}
vidia / activity_main.xml
Created September 29, 2016 19:25
State of the tutorial XML for the TextView tutorial
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android=""
def Main():
fact = 1
for i in range(n,1,-1):
print("The factorial of",n,"is:", fact)
# Recursive
def fact(n):