Skip to content

Instantly share code, notes, and snippets.

View fire's full-sized avatar

K. S. Ernest (iFire) Lee fire

View GitHub Profile
@fire
fire / LineUtil.cs
Created June 11, 2019 05:34 — forked from sinbad/License.txt
Unity 2D Line Segment Intersection
using UnityEngine;
public static class LineUtil {
public static void Swap<T>(ref T lhs, ref T rhs) {
T temp = lhs;
lhs = rhs;
rhs = temp;
}
public static bool Approximately(float a, float b, float tolerance = 1e-5f) {

Implementation of dpi adaption in Godot

The theme is the master class that gets asked for style boxes, constants and fonts all the time. The theme is asked multiple times per node and hundreds of times a frame.

It's that simple. However, there is one great additional thing in Godot which makes the dpi addition easy to implement. There are two ways of accessing values in a theme. theme->get_styebox() and my_control->get_stylebox().

  • When asking the theme, it just calls the hash map with styles, and that's it.
  • When asking a control, it does some logic:
    1. font (cached) the next node up to the tree that has a theme assigned.
  1. check if the theme has the requested style. Yes: return it! No: go to the next Control with a theme.
@fire
fire / hekad.toml
Created September 14, 2018 13:33 — forked from matschaffer/hekad.toml
[StatsdInput]
address = "localhost:8125"
[StatAccumInput]
type = "StatAccumInput"
ticker_interval = 1
emit_in_fields = true
percent_threshold = 95
[statmetric_atlas_encoder]
@fire
fire / README.md
Last active July 17, 2017 02:41 — forked from polvi/README.md
HDFS of Kubernetes

Easiest HDFS cluster in the world with kubernetes.

Inspiration from kimoonkim/kubernetes-HDFS

kubectl create -f namenode.yaml
kubectl create -f datanode.yaml

Setup a port-forward to so you can see it is alive:

@fire
fire / gh-dl-release
Created February 27, 2017 17:48 — forked from maxim/gh-dl-release
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#

Overview

These instructions outline how to install DalmatinerDB on a single node. Scaling out will be covered in a future document. It also covers configuring Telegraf to send in monitoring data and Grafana to build dashboards.

Here's how everything connects together:

dalmatiner architecture

@fire
fire / create-smartos-vm.sh
Created March 20, 2016 07:19 — forked from twobitfool/create-smartos-vm.sh
Create a SmartOS VM in VirtualBox
#!/bin/sh
#
# Creates a SmartOS VM in VirtualBox (assuming you alread have VirtualBox installed)
#
# This script will:
# * Download the latest live ISO image of SmartOS
# * Create a VirtualBox VM, or update an existing VM with the latest ISO
# * Configure the VM with a zones disk, and boot it!
#
#
@fire
fire / vklayer
Created February 20, 2016 00:41 — forked from cheery/vklayer
Run scripts with added vulkan layers
#!/usr/bin/env python
"""
Run programs with added vulkan layers.
Author: Henri Tuhola <[email protected]>
License: MIT
Date: 2016-2-20
"""
import argparse, json, os, sys
@fire
fire / simple_git.md
Created February 13, 2016 04:10 — forked from 17twenty/simple_git.md
A Simple Git branching model

a simple git branching model

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

The gist

@fire
fire / run_letsencrypt
Created February 3, 2016 21:42 — forked from lgg/run_letsencrypt
Let's encrypt auto authenticator runner for multiply domains
#!/bin/bash
#Vars
web_service='nginx'
config_path='/usr/local/letssl/'
le_path='/opt/letsencrypt'
exp_limit=20;
#Func
function check_ssl {