Skip to content

Instantly share code, notes, and snippets.

@yeah
yeah / remove_diacritics.js
Created October 13, 2011 10:55
Remove diacritics (Umlauts, Accents, Special characters) in JavaScript
var diacriticsMap = [
{'base':'A', 'letters':/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},
{'base':'AA','letters':/[\uA732]/g},
{'base':'AE','letters':/[\u00C4\u00C6\u01FC\u01E2]/g},
{'base':'AO','letters':/[\uA734]/g},
{'base':'AU','letters':/[\uA736]/g},
{'base':'AV','letters':/[\uA738\uA73A]/g},
{'base':'AY','letters':/[\uA73C]/g},
{'base':'B', 'letters':/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},
{'base':'C', 'letters':/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},
@twish
twish / reset_display_montaray.md
Created November 15, 2021 15:26
Reset external displays macos monterey

Reset external display configurations in macos Monterey

Background

I had the issue where a display reported a supported resolution that was actually not supported. This caused macos to get stuck in a loop where macos would try to connect to the monitor, succeed. Only to have the monitor disconnect since it did not support the resolution. This made it impossible to manually change the resolution since macos only shows the settings if the display is connected.

After a bunch of googling and trial and error I solved it with the following workaround:

@bgrewell
bgrewell / he-ipv6-udm-pro.md
Last active January 6, 2025 20:22
This gist explains how to set up IPv6 connectivity on your Ubiquiti UDM Pro or similar Ubiquiti devices using a Hurricane Electric (TunnelBroker) tunnel. Enable free IPv6 access to your network without relying on ISP support.

Setup IPv6 Tunnel on Unifi Dream Machine Pro

In order to use IPv6 via a Hurricane Electric tunnel you need to sign up for their free Tunnel Broker service at https://tunnelbroker.net/

Setup Address Allocation

Navigate to https://unifi.ui.com and go to your network management page. Navigate to Settings -> Networks and select the network you wish to enable IPv6 on such as Default then click on the IPv6 button.

  1. Select static for interface type
  2. Under Gateway IP/Subnet enter your Routed IPv6 Prefix from the HE management page
@benbjurstrom
benbjurstrom / Code.gs
Last active January 6, 2025 20:21
PurgeOldEmails
/*
|--------------------------------------------------------------------------
| PurgeOldEmails
|--------------------------------------------------------------------------
| https://gist.github.com/benbjurstrom/00cdfdb24e39c59c124e812d5effa39a
|
*/
// Purge messages automatically after how many days?
var DELETE_AFTER_DAYS = 7
@JerryLokjianming
JerryLokjianming / Crack Sublime Text Windows and Linux.md
Last active January 6, 2025 20:20
Crack Sublime Text 3.2.2 Build 3211 and Sublime Text 4 Alpha 4098 with Hex

How to Crack Sublime Text 3.2.2 Build 3211 with Hex Editor (Windows | Without License) ↓

  1. Download & Install Sublime Text 3.2.2 Build 3211
  2. Visit https://hexed.it/
  3. Open file select sublime_text.exe
  4. Offset 0x8545: Original 84 -> 85
  5. Offset 0x08FF19: Original 75 -> EB
  6. Offset 0x1932C7: Original 75 -> 74 (remove UNREGISTERED in title bar, so no need to use a license)
@souhaiebtar
souhaiebtar / sublime_text.sh
Created April 18, 2021 15:42
sublime text 4094
on linux
https://download.sublimetext.com/sublime-text_build-4094_amd64.deb
cd /opt/sublime_text
printf '\00\00\00' | dd of=sublime_text bs=1 seek=290764 count=3 conv=notrunc
@gagarine
gagarine / fish_install.md
Last active January 6, 2025 20:16
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish

@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active January 6, 2025 20:15
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@gbarrancos
gbarrancos / gist:3277138
Created August 6, 2012 17:57
7 Tips for Successful Self Learning

7 Tips for Successful Self Learning - by Bradford Cross

No matter what, you're going to have to learn most everything on your own anyway. Self-learning is hard. Regardless of where, when or how you learn - being a good self-learner will maximize your potential.

In this post, Hamilton Ulmer (an almost-done Stanford stats masters student) and I, will explore seven ways to become a great self-learner.

The longest path is the shortest and the shortest path is the longest

@bendc
bendc / easing.css
Created September 23, 2016 04:12
Easing CSS variables
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);