Skip to content

Instantly share code, notes, and snippets.

View Gravifer's full-sized avatar

Tci Gravifer Fang Gravifer

View GitHub Profile
@Gravifer
Gravifer / gh_ghost_notification.ps1
Created October 10, 2025 22:49
GitHub ghost notifications powershell fix
# <https://github.com/orgs/community/discussions/6874>, where I cannot even find the source of the Bash version I based this on; this Web UX is c**p
gh api `
--method PUT `
-H "Accept: application/vnd.github+json" `
/notifications `
-f last_read_at="$(date -Format +'YYYY-MM-DDTHH:MM:SSZ')" `
-F read=true
import Lean
open Lean
deriving instance Repr for ParserDescr
unsafe def getParserDescrUnsafe (name : Name) : CoreM (Option ParserDescr) := do
let info ← getConstInfo name
if info.type.isConstOf ``ParserDescr || info.type.isConstOf ``TrailingParserDescr then
return some (← evalConst ParserDescr info.name)
@Gravifer
Gravifer / BucketStack.py
Created November 26, 2024 09:35
Bucket stack value
# https://chatgpt.com/share/674595bf-959c-8007-ab19-7a9d55328526
class BucketStack:
def __init__(self):
self.stack = []
def push(self, bucket):
self.stack.append(bucket)
def pop(self):
if self.stack:
@Gravifer
Gravifer / windowsTerminal_themeToggler.ps1
Last active October 10, 2022 09:17
Windows Terminal theme mode toggler script
# see https://github.com/microsoft/terminal/issues/4066#issuecomment-991775872
# Feature deprecated
# # A Light colorScheme is bound as counterpart to one and only one Dark colorScheme.
# # To configure two colorSchemes as a pair, select one of them as default in dark mode,
# # switch to light mode, select the other as default, then switch back to dark mode;
# # the script will now toggle this pair correctly for any other profile.
param(
[String] $themeMode, # if not provided, default to the opposite of the mode recorded in the config file
@Gravifer
Gravifer / Get-GeoCodeCoordinatesAddress.ps1
Last active June 20, 2021 13:16
PowerShell script to display local weather report
$dependencies = @(
"Get-GeoLocationCoordinates",
)
foreach ($script in ){
iex ((New-Object System.Net.WebClient).DownloadString("https://gist.githubusercontent.com/Gravifer/a0012ea5f115bf48bc652c1b02845bd8/raw/d6d06a82ed8282e14aed0f258ff39b8e89dcf01e/$script.ps1"))
}
function Get-GeoCodeCoordinatesAddress {
param (
[Parameter(ValueFromPipeline=$true)]
@Gravifer
Gravifer / MMA_1lners.md
Last active March 18, 2021 14:43
Mathematica one-liners

Mathematica one-liners

  • Visualize a block matrix mat
    MatrixForm[{Grid[Map[Grid, mat, {2}], Dividers -> Center]}]

performance notes

  • In prototyping, you may use something like
@Gravifer
Gravifer / bucketlist.md
Created February 24, 2021 06:55
My BucketList

My BucketList

  • This list is still far from complete.

  • Coq

  • Lean (prover)

  • Haskell

  • OCaml

@Gravifer
Gravifer / WakaTime.wl
Last active August 29, 2025 02:00
WakaTime API for Mathematica
(* ::Package:: *)
(* ::Title:: *)
(*Mathematica WakaTime Plugin*)
(* ::Author:: *)
(*Author: Gravifer*)
(*Date: 2021-02-21*)
(*Version: 0.0.3*)
@Gravifer
Gravifer / wolfram_paclet_context_install.md
Last active February 16, 2021 09:58
Install Wolfram paclets from the Windows context menu

A little tweaking to install wolfram paclets in the Windows explorer. It is always possible to modify the registry manually; but for a less painstaking way, you can use FileTypesMan by Nir Sofer and Resource Hacker by Angus Johnson.

Paclets are merely .zip archives with concerned .m package files and some versioning code. It's convenient to add unzipping and installing actions to the right-click context menu. For installation:

wolframscript.exe -code "pac=Last[$ScriptCommandLine]; Print[StringJoin[\"Trying to install \", pac, \" ...\"]]; PacletInstall[pac]" "%1"