Skip to content

Instantly share code, notes, and snippets.

View cshaa's full-sized avatar
💭
what kind of cow does oat milk come from... ?

csha cshaa

💭
what kind of cow does oat milk come from... ?
  • Czech Republic
View GitHub Profile
@cshaa
cshaa / Shell_ContextMenu_GitHub.reg
Last active December 26, 2023 05:43
Create neat sub-menus for Windows Explorer directory right-click, one for the Command Line, one for PowerShell and one for Git
Windows Registry Editor Version 5.00
; GitHub Desktop
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuGit\shell\github]
; "Icon"=(REG_EXPAND_SZ)"%LocalAppData%\\GitHubDesktop\\GitHubDesktop.exe"
"Icon"=hex(2):25,00,4c,00,6f,00,63,00,61,00,6c,00,41,00,70,00,70,00,44,00,61,\
00,74,00,61,00,25,00,5c,00,47,00,69,00,74,00,48,00,75,00,62,00,44,00,65,00,\
73,00,6b,00,74,00,6f,00,70,00,5c,00,47,00,69,00,74,00,48,00,75,00,62,00,44,\
00,65,00,73,00,6b,00,74,00,6f,00,70,00,2e,00,65,00,78,00,65,00,00,00
@cshaa
cshaa / fish_and_chips.js
Created May 22, 2018 15:49
Fish and Chips (Tomáš Vido)
function fish_and_chips(cislo) {
if (cislo % 2 == 0) {
if (cislo % 3 == 0)
return "fish and chips"
else
return "fish"
} else {
if (cislo % 3 == 0)
return "chips"
@cshaa
cshaa / README.md
Created May 30, 2018 07:16
File associations for yEd on Ubuntu.

Put graphml.xml to ~/.local/share/mime/packages and yEd Graph Editor-0.desktop to ~/.local/share/applications.

Then run these commands:

update-desktop-database ~/.local/share/applications
update-mime-database    ~/.local/share/mime
@cshaa
cshaa / .XCompose
Last active September 8, 2024 07:44
Math symbols for the compose key
# Math
<Multi_key> <A> <A> : "∀"
<Multi_key> <E> <E> : "∃"
<Multi_key> <exclam> <E> <E> : "∄"
<Multi_key> <minus> <0> : "−"
<Multi_key> <KP_Subtract> <KP_0> : "−"
<Multi_key> <asterisk> <1> : "⋅"
<Multi_key> <KP_Multiply> <KP_1> : "⋅"
@cshaa
cshaa / .XCompose
Created June 7, 2018 12:32
Greek letters for the Compose key
# Greek
<Multi_key> <asterisk> <a> : "α"
<Multi_key> <asterisk> <b> : "β"
<Multi_key> <asterisk> <c> : "ψ"
<Multi_key> <asterisk> <d> : "δ"
<Multi_key> <asterisk> <e> : "ε"
<Multi_key> <asterisk> <f> : "φ"
<Multi_key> <asterisk> <g> : "γ"
<Multi_key> <asterisk> <h> : "η"
@cshaa
cshaa / README.md
Created October 6, 2018 20:22
Example of a markdown-it extension written in TypeScript

Mark Plugin for markdown-it

This is a sample implementation of a basic extension. It uses the @types/markdown-it package from NPM which contains the documentation for markdown-it. The code here is mostly copied from the backtick rule implementation you can find in the original markdown-it repository.

Keywords

Plugin example for markdown-it, extension tutorial, markdown-it extension API, TypeScript, jsDoc, documentation for extensions, specification of plugin API, how to write an extension for markdown-it.

@cshaa
cshaa / ts-unsigned-integer.cpp
Last active October 9, 2018 15:54
TypeScript unsignedInt type definition generator
#include <fstream>
#include <limits>
#include <fcntl.h>
#include <string>
int main() {
int f = 0;
const std::string FILE("unsignedInt");
const std::string EXT(".d.ts");
declare module 'filtrex'
{
/**
* A simple, safe, JavaScript expression engine, allowing end-users to enter arbitrary expressions without p0wning you.
*
* @example
* // Input from user (e.g. search filter)
* let expression = 'transactions <= 5 and abs(profit) > 20.5';
*
* // Compile expression to executable function
@cshaa
cshaa / zenerova_dioda.txt
Created January 15, 2019 07:50
V-A charakteristika Zenerovy diody k úloze 11 předmětu Fyzikální praktikum II
U [V] I [mA]
-6,8587 -750,6055
-6,8563 -734,6088
-6,8556 -775,426
-6,8552 -712,3059
-6,853 -758,4381
-6,8505 -722,9614
-6,8501 -735,4736
-6,8485 -669,0472
-6,8482 -712,2803
@cshaa
cshaa / LambertW.bas
Created April 25, 2019 20:05
Lambert W function, or the product logarithm, for LibreOffice and OpenOffice. Original version for Excel from here: http://www.vbforums.com/showthread.php?683003-Lambert-W-function-for-Excel-work-on-real-and-complex-number
Attribute VB_Name = "Module1"
Function Complex(a As Double, b As Double) As Any
Dim svc As Object
svc = createUnoService("com.sun.star.sheet.FunctionAccess")
Complex = svc.callFunction("COMPLEX",Array(a,b))
End Function
Function ImProduct(a As Any, b As Any) As Any
Dim svc As Object