Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
sindresorhus / TrueColour.md
Created January 17, 2017 11:46 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@qoomon
qoomon / conventional_commit_messages.md
Last active May 1, 2024 16:22
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active May 1, 2024 16:22
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@zhe-t
zhe-t / sendTxWithJito.ts
Last active May 1, 2024 16:20
Smart send a transaction using Jito dedicated endpoint
import { Connection, SendOptions } from '@solana/web3.js';
export type JitoRegion = 'mainnet' | 'amsterdam' | 'frankfurt' | 'ny' | 'tokyo';
export const JitoEndpoints = {
mainnet: 'https://mainnet.block-engine.jito.wtf/api/v1/transactions',
amsterdam: 'https://amsterdam.mainnet.block-engine.jito.wtf/api/v1/transactions',
frankfurt: 'https://frankfurt.mainnet.block-engine.jito.wtf/api/v1/transactions',
ny: 'https://ny.mainnet.block-engine.jito.wtf/api/v1/transactions',
tokyo: 'https://tokyo.mainnet.block-engine.jito.wtf/api/v1/transactions',
};
export function getJitoEndpoint(region: JitoRegion) {
@davydany
davydany / IPTABLES-CHEATSHEET.md
Last active May 1, 2024 16:17
IP Tables (iptables) Cheat Sheet

IP Tables (iptables) Cheat Sheet

IPTables is the Firewall service that is available in a lot of different Linux Distributions. While modifiying it might seem daunting at first, this Cheat Sheet should be able to show you just how easy it is to use and how quickly you can be on your way mucking around with your firewall.

Resources

The following list is a great set of documentation for iptables. I used them to compile this documentation.

struct SoundMakerIntent: AudioPlaybackIntent {
static var title: LocalizedStringResource = "Play a sound"
static var description: IntentDescription = IntentDescription("Plays a widget sound")
@Parameter(title: "Sound")
var sound: WidgetSound
init() {}
init(sound: WidgetSound) {
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@mariovalney
mariovalney / pre-commit
Last active May 1, 2024 16:12
Pre-commit hook to check code with PHPCS, fix with PHPCBF and check mess with PHPMD
#!/bin/sh
#########################
# #
# Initializing #
# #
#########################
##
# You should add all tools as composer dependencies or change this path
@scrapix
scrapix / DSM7.2-USB-DRIVER.md
Last active May 1, 2024 16:12
Synology DSM 7.2 - Adding USB Devices / Dongles (SkyConnect / Z-Wave)

Adding SkyConnect Dongle according to Blog Post or better Youtube

image

Summary

Synology has disabled USB drivers. Additionally one important driver is not available on Synology DSM 7+. Thus we need to enable some USB drivers plus download one driver and enable this on the system. For future DSM updates we need to add a Scheduled Task, so that the drivers will be loaded.

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r