Skip to content

Instantly share code, notes, and snippets.

View Gravifer's full-sized avatar

Tci Gravifer Fang Gravifer

View GitHub Profile
@kepler-5
kepler-5 / comp_multi.rs
Last active June 14, 2025 07:13
Python comprehension proc macro that handles multiple nested for-if-clauses, flattening nested structure
// This is free and unencumbered software released into the public domain.
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
// In jurisdictions that recognize copyright laws, the author or authors
// of this software dedicate any and all copyright interest in the
// software to the public domain. We make this dedication for the benefit
@Chubek
Chubek / README.md
Last active May 3, 2025 14:10
EBNF Grammar for AWK

Note: if you wish to understand these notations, please read this: https://gist.github.com/Chubek/52884d1fa766fa16ae8d8f226ba105ad

So, again, why did I write the EBNF grammar for AWK?

Basically, I have two ongoing projects where AWK is involved. Firs is Squawk, and implementation of AWK and second is AWK2c, which obviously translates AWK to C.

Plus, I am thinking of making a Github page called 'The Internet Grammar Database' where I would post EBNF, Yacc, PEG, Lex, definitions of languages. However, I don't have much experience in web development, so if you can help me, let me know (chubakbidpaa [at] riseup [dot] net).

So anyways, awk.ebnf contains the EBNF grammar for AWK. Some considerations:

@Chubek
Chubek / README.md
Last active April 16, 2025 10:43
EBNF Grammar for C

c.ebnf contains grammar ofr C99. Note that this is ANSI C, not ISO C, so there are some omissions. The reason I wrote this is, I am currently writing a C compiler, with my own backend (and hopefully, frontend) in OCaml. And I needed to collect the grammar in one place.

How to Read EBNF Grammars?

Reading EBNF grammars is pretty simple:

  • Enclosed within two ?s is a global capture, it does not mean optional. It means 'I am writing a free-style sentence'.
  • Enclosed within { and } means : repeat at least zero times
  • Enclosed within [ and ] means : this is optional
  • Enclosed within ( and ) means : this is a group
@vnext-nguyen-quyen
vnext-nguyen-quyen / emeditor.key
Created September 9, 2023 14:43
emeditor v22 lifetime key
DEMZF-UCKEE-HB222-DJDDH-594U5
DMAZF-UCKEE-A6222-8CADP-HQZ7H
DPAZF-UCKEE-FH222-ET546-DLRGT
DRNZF-UCKEE-UK222-RWNLU-XVZH7
DSBZF-UCKEE-BF222-K24JB-S9JLC
DSHZF-UCKEE-D3222-NMB93-UKSQF
DTHZF-UCKEE-BW222-Q2BKZ-NXPU8
DVAZF-UCKEE-J7222-5UHCT-QSRFE
DVEZF-UCKEE-PR222-ZAPFE-4C49Q
@burrielrush
burrielrush / AllAmericanRegex.md
Last active June 11, 2025 14:52
This is a Gist breaking down credit card validation Regex

All American Regex

(Credit card # validation regular expression)

The regex \b(?:\d[ -]*?){13,16}\b is a powerful tool used for validating credit card numbers. Credit card numbers typically consist of a sequence of 13 to 16 digits, with optional spaces or dashes in between. This regular expression applies the Luhn algorithm to ensure the validity of credit card numbers by checking for the correct number of digits and the proper formatting. By using this regular expression, developers can easily implement credit card number validation in their applications, helping to enhance security and prevent errors during data entry.

Summary

@muink
muink / Universal-Captive-Portal-Server.md
Last active June 13, 2025 02:52
通用 Captive Portal 檢測伺服器, 在中國大陸也可用

Universal Captive Portal Detection Server

http(s)://edge.microsoft.com/captiveportal/generate_204
http(s)://cp.cloudflare.com/generate_204
http(s)://www.qualcomm.cn/generate_204
http(s)://connectivity.samsung.com.cn/generate_204
http(s)://captiveportal.kuketz.de

@pratyakshm
pratyakshm / Sideloading_apps_in_WSA.md
Last active June 1, 2025 17:39
Sideloading apps on Windows Subsystem for Android in Windows 11

Sideloading APKs in to Windows Subsystem for Android

Update (9th July, 2022): An app is available that does just this.

Check out WSATools by Simone Franco: https://www.microsoft.com/store/apps/9N4P75DXL6FG


Setting up ADB to work with WSA

  • Launch Windows Subsystem for Android.
@dominikwilkowski
dominikwilkowski / README.md
Last active May 22, 2025 07:51
ANSI codes for cli controled output

ANSI escape sequences

ANSI escape sequences can be printed to a shell to as instructions. The below is a list of codes I have used often in my CLI programs and I find myself looking up over and over again.

A great article about it can be found here.

Content

@robertohuertasm
robertohuertasm / .licrc
Last active December 29, 2024 02:59
Simple .licrc config file for Licensebat
# IMPORTANT!: ALL SECTIONS ARE MANDATORY
[licenses]
# This indicates which are the only licenses that Licensebat will accept.
# The rest will be flagged as not allowed.
accepted = ["MIT", "MSC", "BSD"]
# This will indicate which licenses are not accepted.
# The rest will be accepted, except for the unknown licenses or dependencies without licenses.
# unaccepted = ["LGPL"]
# Note that only one of the previous options can be enabled at once.
# If both of them are informed, only accepted will be considered.
@dend
dend / toast.ps1
Last active May 21, 2025 09:34
Toast Notification in PowerShell
function Show-Notification {
[cmdletbinding()]
Param (
[string]
$ToastTitle,
[string]
[parameter(ValueFromPipeline)]
$ToastText
)