Skip to content

Instantly share code, notes, and snippets.

@joe-scotto
joe-scotto / Animation
Last active May 5, 2024 14:50
QMK OLED Displays
#ifdef OLED_ENABLE
// Rotate OLED
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_90;
}
// Animation parameters
#define FRAME_DURATION 333 // How long each frame lasts in milliseconds
@davidfoster
davidfoster / KalmanFilterFloat.cs
Last active May 5, 2024 14:49
Simple Kalman filtering in Unity.
using System.Collections.Generic;
/// <summary>A Kalman filter implementation for <c>float</c> values.</summary>
public class KalmanFilterFloat {
//-----------------------------------------------------------------------------------------
// Constants:
//-----------------------------------------------------------------------------------------
public const float DEFAULT_Q = 0.000001f;
@Klerith
Klerith / instalaciones.md
Last active May 5, 2024 14:45
Instalaciones recomendadas - Curso de Angular de cero a experto
@eduardozulian
eduardozulian / wp-taxonomy-dropdown.php
Last active May 5, 2024 14:45
Callback function for 'meta_box_cb' argument inside register_taxonomy() that replaces the regular checkboxes with a plain dropdown list
<?php
/**
* Callback function for taxonomy meta boxes
*
* A simple callback function for 'meta_box_cb' argument
* inside register_taxonomy() that replaces the regular
* checkboxes with a plain dropdown list
*
* @param [type] $post [description]
* @param [type] $box [description]
@jpassaro
jpassaro / 00-unicode-cheat-sheet.md
Last active May 5, 2024 14:44
Unicode cheat sheet

Unicode cheat sheet

A curated list of unicode characters I want to have quick reference toward, including their literal presentation (where possible), description from the unicode table, various representations, and how to enter it as a Vim digraph*.

They are grouped by category, including a link to the relevant Unicode block. Also see the full list of Unicode blocks

@x011
x011 / imacros-cheatsheet.md
Created October 7, 2016 12:07
iMacros Command, Variable, and function reference
@novemberborn
novemberborn / setup.md
Created January 7, 2016 15:05
OS X Redirect ports 80 and 443 to 8080 and 8443 respectively

Changes with .dev domains in mind.

Create /etc/pf.anchors/dev, containing:

rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443

{
"Barisal": ["Barguna", "Barisal", "Bhola", "Jhalokati", "Patuakhali", "Pirojpur"],
"Chittagong":["Bandarban","Brahmanbaria", "Chandpur", "Chittagong", "Comilla", "Cox's Bazar","Feni", "Khagrachhari","Lakshmipur", "Noakhali", "Rangamati"],
"Dhaka": ["Dhaka", "Faridpur", "Gazipur", "Gopalganj", "Kishoreganj","Madaripur", "Manikganj","Munshiganj", "Narayanganj","Narsingdi","Rajbari","Shariatpur","Tangail"],
"Khulna": ["Bagerhat", "Chuadanga", "Jessore", "Jhenaidah", "Khulna", "Kushtia", "Magura", "Meherpur", "Narail", "Satkhira"],
"Mymensingh":["Jamalpur", "Mymensingh", "Netrakona","Sherpur"],
"Rajshahi" :["Bogra", "Chapainawabganj","Joypurhat","Naogaon", "Natore", "Pabna", "Rajshahi", "Sirajganj"],
"Rangpur" :["Dinajpur", "Gaibandha", "Kurigram", "Lalmonirhat","Nilphamari", "Panchagarh", "Rangpur", "Thakurgaon"],
"Sylhet" :["Habiganj", "Moulvibazar", "Sunamganj","Sylhet"]
}
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active May 5, 2024 14:39
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
@mara004
mara004 / pypdfjs.py
Last active May 5, 2024 14:39
PDF rendering with pdf.js, from Python
# SPDX-FileCopyrightText: 2023 mara004
# SPDX-License-Identifier: CC-BY-4.0 OR Apache-2.0
# See also https://github.com/extremeheat/JSPyBridge/blob/master/examples/python/pdfjs.py
# Py-Depends: pillow, javascript >= 1.1.0 (jspybridge)
# Js-Depends: pdfjs-dist, canvas
# Use `python -m pip install` and `python -m javascript --install`
import argparse