Skip to content

Instantly share code, notes, and snippets.

View psygo's full-sized avatar
🎯
focusing

Philippe Fanaro psygo

🎯
focusing
View GitHub Profile
@psygo
psygo / reflection_and_annotations.md
Last active March 31, 2024 16:48
Reflection and Annotations in Dart

Reflection in Dart

Unfortunately, [since mirrors currently bloat compiled code][no_support_mirrors], it isn't supported for Flutter or web apps. A [workaround][source_gen_tutorial] would be to use a package like [source_gen][source_gen].

dart:mirrors

Most of the info here, comes from [Understanding Reflection and Annotations in Dart tutorial][reflection_tutorial], from the Fullstack Dart and Flutter Tutorials YouTube channel. He also created a [gist][gist_tutorial] with it.

@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 / academind_ts_notes.md
Created November 5, 2020 21:24
Academind's TypeScript Course Notes

Academind's Tutorial

Overview

  • Static error checking is always better than runtime crazy ones.
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 / .vimrc
Created February 18, 2021 01:37
Do 90% of What Vim Plugins with Only Vim
set hlsearch
" Don't bother with pretending that it wants to be compatible with Vi
set nocompatible
" Enable syntax and plugins (for netrw)
syntax enable
filetype plugin on
" Finding Files:
@psygo
psygo / artix.md
Created February 26, 2021 14:10
Arch/Artix Installation (also includes dual-booting with Windows)
@psygo
psygo / gmail_signature.html
Last active August 25, 2023 18:13
Gmail Signature
<!-- Doesn't work for GMAIL sadly...
<script
type="text/javascript"
src="https://platform.linkedin.com/badges/js/profile.js"
async
defer>
</script> -->
<!-- Doesn't work for GMAIL either; no JS will work apparently
<script>
@psygo
psygo / joker_baduk.md
Created September 13, 2020 00:15
Joker Baduk

Joker Baduk

  1. 상대방의 돌로 2수 두세요 play two moves with your opponent stones..... Illegal moves are not allowed
  2. 야호! Play two moves wherever you want
  3. 꽝 pass
  4. 가위,바위,보를 winner can change the opponent's stone to his buke....the one who has more buke shapes, gets two captured stone.
  5. 1선에 3수를 play 3 moves on the first line
  6. 공짜 한수 play one move and get another card
  7. 상대에게 내 이름을 물어보세요 ask your opponent: what is my name? If he knows u give 2 points
  8. 키가 큰 사람이 작은사람에게 taller gives 2points to the smaller one
@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.