Skip to content

Instantly share code, notes, and snippets.

@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active May 20, 2024 18:23
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active May 20, 2024 18:23
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@zeljic
zeljic / build_sqlite3_lib.md
Last active May 20, 2024 18:23
Build SQLite3 .lib file on windows

How to build SQLite3 .lib file on Windows 10

  1. Download source from source

    For example: source https://www.sqlite.org/2023/sqlite-amalgamation-3430100.zip

  2. Download binary from binary

    For example: binary https://www.sqlite.org/2023/sqlite-dll-win64-x64-3430100.zip

  3. Extract both archives to the same directory

@thalesmg
thalesmg / readme.org
Created February 15, 2020 17:24
Recursively traverse a directory tree mapping config files for Nix Home Manager
ͳ nix eval '(let f = import ./recurseTree.nix; in f "")' | nixfmt
{
  xdg = {
    configFile = {
      "something/b/d/e" = { source = /tmp/nixtest/b/d/e; };
      "something/c" = { source = /tmp/nixtest/c; };
      "something/recurseTree.nix" = { source = /tmp/nixtest/recurseTree.nix; };
    };
  };
@BlueDrink9
BlueDrink9 / lazy.nvim adapter for vim-plug.md
Last active May 20, 2024 18:21
Share your vim-plug plugins with your lazy.nvim neovim setup, with minimal performance loss

lazy.nvim adapter for vim-plug

This is a drop-in adapter layer for vim-plug and lazy.nvim, allowing you to have a core set of vim plugins, configured with Plug, which will also be loaded using lazy.nvim instead whenever you use neovim (alongside any additional set of lazy.nvim plugins you have configured.)

It works by adding a new command Plugin as a drop-in Plug replacement. That calls a function that sets up lazy.nvim specs for the equivalent Plug args, and stores them in a variable that you can then add to your lazy spec.

@jgwerner
jgwerner / kecloak_saml_poc.md
Last active May 20, 2024 18:19
Keycloak + JupyterHub + SAML v2.0 PoC

Keycloak + JupyterHub + ingress-nginx + AWS NLB

Overview

We have successfully set up a working version of Keycloak with Kubernetes (we are using AWS EKS) with JupyterHub using the [ingress-nginx)(https://github.com/kubernetes/ingress-nginx) as a reverse proxy. Keycloak is set up with JupyterHub as a standard OIDC client (confidential) and the JupyterHub successfully redirects to the Keycloak page that prompts the user to login. (For FYI this configuration is set up with the GenericOAuthenticator).

The Keyclaok Identity Provider has been tested with multiple third-party SAML IdP's, such as Okta and Auth0. The Keycloak broker successfully connects with the IdP and the user is prompted to add their credentials. After succussfully authenticating, however, the Keycloak service returns:

14:39:41,946 WARN  [org.keycloak.events] (default task-60) type=IDENTITY_PROVIDER_RESPONSE_ERROR
@firexcy
firexcy / readme.md
Last active May 20, 2024 18:19
DIY a Rewind.ai

This Gist provides a solution to periodically capture screenshots of your Mac, and create therefrom a searchable PDF archive so that you can always get an answer to the “what, when, and where” questions about your usages.

To use these scripts:

  1. Download the shell script rewind, then:
    1. put it under ~/bin (or other fixed path you prefer);
    2. execute
@wojteklu
wojteklu / clean_code.md
Last active May 20, 2024 18:19
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@clipperhouse
clipperhouse / runereader.go
Created May 21, 2018 22:29
A PeekRune method for bufio.Reader
package jargon
import (
"bufio"
"fmt"
"io"
"unicode/utf8"
)
type RuneReader struct {
@Silvyre
Silvyre / ACCio.dat
Last active May 20, 2024 18:16
🧙🐑 AutoControl for Colonist.io (ACCio): play Colonist.io using your keyboard! Setup instructions in comments below.
{"customEntities":{"script":[["1",{"name":"wall.js","value":{"mdTime":1641400238352,"srcCode":"await ACCio(_ => {\n socketGameSend.buildCityWall();\n selectNextAfterDelay();\n});"}}],["2",{"name":"setup.js","value":{"mdTime":1656815986599,"srcCode":" try {\n return ACCio(_ => console.log(\"ACCio is already enabled! Try refreshing if you're having trouble.\"));\n }\n catch (e) { console.error(e) }\n\n try {\n await ACtl.runInPageCtx('https://cdn.jsdelivr.net/gh/CoeJoder/waitForKeyElements.js@v1.2/waitForKeyElements.js');\n }\n catch {\n return ACtl.runInPageCtx(_ => console.error('ACCio failed to load all required libraries.'));\n }\n\n ACCio = new Proxy(ACtl.runInPageCtx, {\n apply: (target, thisArg, argumentsList) => {\n if (['INPUT', 'TEXTAREA'].includes(document.activeElement.tagName)) {\n return;\n }\n\n try { return target(...argumentsList); }\n catch (e) { console.error(e) }\n }\n });\n\n await ACtl.runInPageCtx(_ => waitForKeyElements('canvas[style*