Skip to content

Instantly share code, notes, and snippets.

View lincerely's full-sized avatar
🕹️

Lincerely lincerely

🕹️
View GitHub Profile
@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 / 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 / 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 / print-user.sh
Last active May 4, 2018 18:56
Print /etc/passwd as beautified table
column -t -s : /etc/passwd
@lincerely
lincerely / typed.html
Last active July 30, 2018 12:09
typed js example
<html>
<head>
<title> typed js example </title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.8/typed.min.js"></script>
</head>
<body>
<p>Typed js is typing: <span id="type-me"></span></p>
<script>
@lincerely
lincerely / gogs.svg
Created July 30, 2018 17:15
Gogs icon optimized for web (monotonic)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
set tabstop=4
set shiftwidth=4
set ls=2
set number
set relativenumber
set diffopt+=internal,algorithm:patience
set splitbelow
set splitright
/* 15jul14abu
* 06dec12jk
* (c) Software Lab. Alexander Burger
*/
html {
background-color: #ddd;
}
body {
@lincerely
lincerely / gdbm_example.c
Last active April 9, 2020 06:20
C by Example: GDBM
// gdbm_example.c
// CFLAGS = -Wall -Wextra -Werror -O2 -std=c99 -pedantic -lGDBM
#include <stdio.h>
#include <string.h>
#include <gdbm.h>
#include <stdlib.h>
GDBM_FILE dbf;
#!/usr/local/plan9/bin/rc
. 9.rc
. $PLAN9/lib/acme.rc
if(~ $#* 0 1){
echo >[1=2] usage: adiff file1 file2
echo >[1=2] or adiff file1 file2... dir
exit usage