Skip to content

Instantly share code, notes, and snippets.

@utensil
utensil / Railscasts-Renewed.json
Last active October 8, 2024 11:47
A Railscasts-Renewed theme for Zed, imported from https://github.com/PaulOlteanu/Railscasts-Renewed, used a bit One Dark to fix empty fields, tweak a bit to actually match VSCode colors
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"name": "Railscasts Renewed",
"author": "Utensil Song",
"themes": [
{
"name": "Railscasts Renewed Dark",
"appearance": "dark",
"style": {
"background.appearance": "opaque",

Github to Discord Webhook Tutorial

In this tutorial I'll show you how to create a Github webhook that will post updates from your Github account to a channel in Discord. The steps are simple so follow along!

Create a Webhook in a Discord Channel

First you need to create a webhook in a text channel. We're assuming you have both Manage Channel and Manage Webhooks permissions!

  • Go in a channel properties (Alternatively, Server Settings, Webhooks works too)
@utensil
utensil / GeometricGrades.lean
Created November 21, 2023 15:08 — forked from eric-wieser/GeometricGrades.lean
Grade selection with Mathlib
import Mathlib.LinearAlgebra.CliffordAlgebra.Contraction
import Mathlib.LinearAlgebra.ExteriorAlgebra.Grading
set_option pp.proofs.withType false
variable {R M} [CommRing R] [Invertible (2 : R)] [AddCommGroup M] [Module R M] (Q : QuadraticForm R M)
abbrev ExteriorAlgebra.rMultivector (r : ℕ) : Submodule R (ExteriorAlgebra R M) :=
(LinearMap.range (ExteriorAlgebra.ι R : M →ₗ[R] _) ^ r)
@utensil
utensil / SpellCheck.lean
Last active October 12, 2023 08:35
SpellCheck.lean
/-
This file demonstrates the use of VSCode [Spell Right](https://marketplace.visualstudio.com/items?itemName=ban.spellright)
extension to spell check comments in Lean 4 files while avoiding code or code blocks in comments, it uses some heuristics
to work for both Markdown and [reStructuredText](https://devguide.python.org/documentation/markup/) per request on
[Zulip](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Spell.20check).
The minimal configuration to make it work for Lean is to add the following to your `settings.json` after the installing
the extension, setting up [the spell check dictionaries](https://github.com/bartosz-antosik/vscode-spellright#dictionaries),
and [enable spell check for the language of your choosing](https://github.com/bartosz-antosik/vscode-spellright#changing-language-and-turning-off):
@utensil
utensil / lean-live-dark.css
Last active October 13, 2023 06:42
live.lean-lang.org Dark Mode
/*
You may use it via https://github.com/openstyles/stylus/ , matching url prefix: https://live.lean-lang.org/
*/
/*
Code for dark style of the Monaco editor
@utensil
utensil / why.md
Created August 10, 2020 15:32
Why formalize? Why Lean?

Why formalize? Why Lean?

Why should mathematicians care about formalization?

Why Lean might be a better choice for mathematicians?

Quotes from CICM 2020 Slack chat log

Can we get one system which is capable of understanding all of the mathematics in my university's undergraduate pure maths degree?

Basic guide to tactics

This guide might be of use when you are in a situation where you know exactly what you want to do "in real life" in your proof, but don't know how to do it in Lean. For example, you might be faced with a hypothesis of the form p ∧ q and you need a proof of p, or you might be faced with a goal of the form p ∨ q which you want to deduce from a proof of p.

How to use the guide

Let's say that you know your next step involves p ∧ q in some way. Which tactic you use depends on whether p ∧ q is a hypothesis (i.e. you have the assumption H : p ∧ q in your local context) or the goal (i.e. what you are trying to prove). If it is a hypothesis then you need to eliminate it, whereas if it is the goal then you need to introduce it

Once you have established whether you want to introduce or eliminate it, find the function in the list below and you will see the tactic you need. Click on the link to see an example of usage.

@utensil
utensil / writings.txt
Created July 28, 2018 14:50
Training materials
岩浆
----
时偿积欠缺填勉, 凝途失涩兴阑珊。
奔流方遒黯如没, 趣中汲静思里安。
泳夜
----
@utensil
utensil / CMakeLists.txt
Created June 4, 2014 13:59
CMake Test
cmake_minimum_required(VERSION 2.8)
macro (show variable value)
message("${variable} = ${value}")
endmacro()
function(join VALUES GLUE OUTPUT)
string (REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}")
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
endfunction()