Skip to content

Instantly share code, notes, and snippets.

@jon3laze
jon3laze / SUPPORTED_LANGUAGES.md
Created February 18, 2025 21:09
Markdown Code Blocks - Supported Languages

Supported Languages

The table below shows the full list of languages (and corresponding classes/aliases) for markdown codeblocks.

Language Aliases
1C 1c
4D 4d
ABAP sap-abap, abap
@calvang
calvang / pika_mock.py
Created July 11, 2021 03:01
Mock AMQP connection using Pika RabbitMQ Client
from unittest.mock import patch
import pika
def callback_func(channel, method, properties, body):
print("Message consumed:", body)
@patch("pika.BlockingConnection", spec=pika.BlockingConnection)
def mock_publish(mock_conn):
def side_effect_publish(exchange, routing_key, body):
print(f"Message published to {routing_key}:", body)
@cscalfani
cscalfani / ElmVSPurescript.pdf
Last active August 27, 2021 15:03
Here are the slides to the first lecture in my training class I'm running at work for the Elm programmers to help them transition to PureScript.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cb109
cb109 / vscode_python_sort_imports_isort_on_save.md
Last active April 29, 2025 08:19
VSCode: Python Sort Imports on File Save (isort)

VSCode: Python Sort Imports on File Save (isort)

  • Make sure the isort extension is installed in VSCode

Update April 2025

The latest VSCode update brought the requirement to use a python environment 3.8+ for isort:

2025-04-24 13:28:29.888 [info] No interpreter found from setting isort.interpreter
@JBlond
JBlond / bash-colors.md
Last active December 6, 2025 01:57 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
/*
Solution of: https://www.codewars.com/kata/545434090294935e7d0010ab
*/
var query = function () {
var self = {};
var tables = [];
var selector = null;
@luochen1990
luochen1990 / 2048.hs
Created June 27, 2015 14:42
2048 game in Haskell
{-# LANGUAGE ForeignFunctionInterface #-}
import System.Console.ANSI (clearScreen)
import Data.Char
import Foreign.C.Types
import Prelude hiding (Left, Right)
import GHC.Exts (groupWith, sortWith)
import Control.Arrow
import System.Random
import System.IO
import Data.Hashable
@pushmatrix
pushmatrix / wordlist
Last active October 17, 2025 12:37
Complete Swedish Duolingo word list (as of March 15, 2015)
man
kvinna
är
pojke
flicka
jag
en
han
hon
ett
@IQAndreas
IQAndreas / caesar-cipher.sh
Last active September 22, 2025 01:24
A really simple Caesar Cipher in Bash (or Shell) using `tr`, can also easily be adjusted to encrypt/decrypt ROT13 instead.
# Caesar cipher encoding
echo "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" | tr '[A-Z]' '[X-ZA-W]'
# output: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
# Caesar cipher decoding
echo "QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD" | tr '[X-ZA-W]' '[A-Z]'
# output: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
# Can also be adjusted to ROT13 instead