Skip to content

Instantly share code, notes, and snippets.

View psygo's full-sized avatar
🎯
focusing

Philippe Fanaro psygo

🎯
focusing
View GitHub Profile
export default class EventEmitter
{
constructor()
{
this.callbacks = {}
this.callbacks.base = {}
}
on(_names, callback)
{
@psygo
psygo / sgf_parser.ts
Created November 26, 2023 00:30
Custom SGF Parsing
export const sgf1 =
"(;GM[1]FF[4]CA[UTF-8]AP[Sabaki:0.52.2]KM[6.5]SZ[19]DT[2023-11-16]AB[qc][pc][oc]AW[od][pd][qd]C[Hello there]PB[Player 1]BR[1p]PW[Philippe Fanaro]WR[2d]GN[Game Name]EV[Event 1]GC[This is an info comment]RE[B+1.5];B[pg]C[This is the second comment];W[qi](;PL[B]AB[qk][ok];B[pm](;W[qo];B[dp];W[dl];B[dn])(;W[rm];B[ro]))(;B[dd];W[df]))";
export const sgf7 =
"(;GM[1]FF[4]CA[UTF-8]AP[Sabaki:0.52.2]KM[6.5]SZ[19]DT[2023-11-25];B[pd](;W[md])(;W[pf]))(;GM[1]FF[4]CA[UTF-8]AP[Sabaki:0.52.2]KM[6.5]SZ[19]DT[2023-11-25];B[qd](;W[oc])(;W[pd]))";
export type BranchSegments = {
id?: number;
parentId?: number | null;
data: string;
@psygo
psygo / ogs_profile_customization.css
Last active December 7, 2021 00:02
OGS Profile Customization
body {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
text-align: center;
}
.container {
max-width: none !important;
background: linear-gradient(to bottom right, #000000, #0b040c, #13091a, #181029, #1a1936, #1a2441, #183049, #153c4d, #14494e, #16554a, #1a6045, #236a3d, #307136, #407631, #53792e, #697a30 ,#7f7a36, #957941, #a97851, #ba7964, #c77a7b, #cf7e92, #d384a9, #d48cbf, #d196d1, #cda2e0, #c8afea, #c3bcf0, #c1caf3, #c2d6f2, #c5e0f1, #cde9ef, #d7f1ee, #e4f6f0, #f1fbf5, #ffffff) !important;
}
@psygo
psygo / scrabble.tex
Last active November 6, 2021 22:11
Scrabble on 19x19, as a background for a Goban
\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{shapes.geometric}
\def\lettertoscrabblescore#1{%
\def\tmp{#1}%
\expandafter\count\expandafter0\expandafter`#1\relax\advance\count0 by-65\relax%
\ifcase\count0\relax%
1\or3\or3\or2\or1\or4\or2\or4\or1\or8\or5\or1\or3\or1\or1\or3\or10\or1\or1\or1\or1\or4\or4\or8\or4\or10\else\fi}
% It comes from here: https://tex.stackexchange.com/a/194797/64441
% And here: https://forums.online-go.com/t/board-backgrounds-library/29388/80
@psygo
psygo / ogs_custom_diamond_stones.js
Created November 5, 2021 18:34
OGS Custom Diamond Stones from Greasy Fork
// ==UserScript==
// @name ogs custom stones
// @version 0.1
// @description custom stones on OGS
// @author michiakig
// @match https://online-go.com/*
// @run-at document-idle
// @namespace https://greasyfork.org/users/592542
// ==/UserScript==
@psygo
psygo / edouard.md
Created May 10, 2021 14:45
Édouard's Raspberry Pi Course

Édouard's Raspberry Pi Course

Tags: Raspberry Pi, Electronics

Raspberry Pi For Beginners - 2021 Complete Course | Udemy

  • The current limit for the Raspberry Pi is near 15 mA.
  • When using an infinite loop, use time.sleep to consume less CPU usage.
  • hostname -I for the IP address on the network.
  • df -h for the available space on the SD card.
@psygo
psygo / nginx.md
Created April 15, 2021 00:48
NGINX Fundamentals

nginx

NGINX Fundamentals: High Performance Servers from Scratch | Udemy

About NGINX

  • Developed by Igor Sysoev in 2005 out of frustrations with Apache.
  • It can handle tens of thousands of concurrent connections.
  • Has quickly surged in popularity.
  • It's usually used as a web server, but it's actually a broader type of server: reverse proxy server.
@psygo
psygo / cedilla_arch.md
Created March 7, 2021 01:09
Proper Cedilla under the US Intl with Dead Keys Layout

Proper Cedilla under the US Intl with Dead Keys Layout

You can find the source of this info [here][gist].

  1. Edit the following files to have :en at the end of the cedilla line.
    sudo vim /usr/lib/gtk-3.0/3.0.0/immodules.cache
    sudo vim /usr/lib/gtk-2.0/2.10.0/immodules.cache
  2. Replace "ć" to "ç" and "Ć" to "Ç" on /usr/share/X11/locale/en_US.UTF-8/Compose
@psygo
psygo / artix.md
Created February 26, 2021 14:10
Arch/Artix Installation (also includes dual-booting with Windows)