Skip to content

Instantly share code, notes, and snippets.

View lincerely's full-sized avatar
🕹️

Lincerely lincerely

🕹️
View GitHub Profile
@lincerely
lincerely / print-user.sh
Last active May 4, 2018 18:56
Print /etc/passwd as beautified table
column -t -s : /etc/passwd
@lincerely
lincerely / Unity.shader
Created February 2, 2018 10:36
Shaderlab sample with notes in comment
Shader "Unlit/UnityShader"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100 //level of detail
@lincerely
lincerely / vnr.bash
Last active February 13, 2020 08:29
"Visual novel reader" Mac workaround
#!/bin/bash
# How to use:
# 1. Download this script
# 2. Open any game made with rpg maker/ wolf rpg, using wine with JP encoding, for example:
# LC_ALL=ja_JP.UTF-8 LANG=ja_JP.UTF-8 wine Game.exe
# 3. Get the coordinate of the textbox, you can use Cmd-Shift-4 to find the value.
# 4. Change the config below
# 5. Save and Run the script
@lincerely
lincerely / DrawRectWithWidth.cpp
Last active December 14, 2017 18:05
A function to render rectangle with width in SDL2
/**
* @brief Render rectangle with width
* @details It is created by overlapping two filled rects
*
* @param renderer current renderer
* @param dest Destination
* @param width Stroke width
* @param rR rectangle's color red component
* @param gR rectangle's color green component
* @param bR rectangle's color blue component
@lincerely
lincerely / .gitignore
Created October 21, 2017 10:53
My Unity .gitignore
# ===========================
# Default Collab Ignore Rules
# ===========================
# OS Generated
# ============
.DS_Store
._*
.Spotlight-V100
.Trashes
@lincerely
lincerely / WebSocket-temp-logger.md
Last active March 24, 2021 02:01
Logging raspberry pi temperature with Websocketd and Smoothie Charts

Install websocketd

wget https://github.com/joewalnes/websocketd/releases/download/v0.2.12/websocketd-0.2.12-linux_arm.zip
unzip websocketd-0.2.12-linux_arm.zip

Listen at port 8080

@lincerely
lincerely / setTime.sh
Created August 31, 2017 03:22
Set time to Hong Kong Observatory standard time
sudo ntpdate -u stdtime.gov.hk
@lincerely
lincerely / nginx.conf
Last active May 31, 2017 11:50 — forked from atma/nginx.conf
Nginx + nodejs + socket.io websockets with index.html on root
# Add to nginx.conf http section
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
@lincerely
lincerely / GameManager.cs
Last active May 19, 2017 18:46
Unity Singleton GameManager
using UnityEngine;
using System.Collections;
public class GameManager : MonoBehaviour {
public static GameManager manager; //singleton
void Awake(){
if(manager == null){
DontDestroyOnLoad(gameObject);
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from spell import *
updater = Updater(token="")
dispatcher = updater.dispatcher
import logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)