Skip to content

Instantly share code, notes, and snippets.

@fomachanyade
fomachanyade / list_break_plugin.tsx
Created February 21, 2025 06:15
lexical list break with backspace
import { $isListItemNode, ListItemNode } from '@lexical/list';
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
import { mergeRegister } from '@lexical/utils';
import {
$createParagraphNode,
$createTextNode,
$getSelection,
$isRangeSelection,
COMMAND_PRIORITY_HIGH,
DELETE_CHARACTER_COMMAND,
@davecra
davecra / detectMimeType.js
Created December 31, 2022 02:53
A JavaScript function to detect the Media/Mime Type for a base64 string
/**
* Returns the data type based on the base64 string
* @param {String} base64String
* @param {String} fileName
* @returns {String}
*/
detectMimeType(base64String, fileName) {
var ext = fileName.substring(fileName.lastIndexOf(".") + 1);
if (ext === undefined || ext === null || ext === "") ext = "bin";
ext = ext.toLowerCase();
@qti3e
qti3e / README.md
Last active January 12, 2026 15:29
List of file signatures and mime types based on file extensions
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active March 19, 2026 20:51
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@rauchg
rauchg / README.md
Last active December 30, 2025 06:51
require-from-twitter
@prabeengiri
prabeengiri / native_app_launcher.js
Last active July 3, 2025 00:54
Native App Launcher (Works in ios9)
// NativeAppLauncher.
// Copied from bartt.me/openapp
var NativeAppLauncher = (function () {
var IOS_VERSION_RE = /OS\s+(\d)_/;
var timers = [];
var userAgent = window.navigator.userAgent;
var isAndroid = function () {
return /Android/.test(userAgent);
};
var isIOS = function () {
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active March 16, 2026 18:55
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@jo
jo / js-crypto-libraries.md
Last active January 17, 2026 16:10
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@Stanback
Stanback / nginx.conf
Last active February 6, 2026 04:08 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which