Skip to content

Instantly share code, notes, and snippets.

@vuon9
vuon9 / README.md
Created Feb 20, 2022 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)
View README.md

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

@vuon9
vuon9 / settings.json
Created Jan 31, 2022
Go (golang) - editor.tokenColorCustomizations vscode settings
View settings.json
{
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
//following will be in italic (=FlottFlott)
"comment",
"entity.name.type.class", //class names
"keyword", //import, export, return…
"constant", //String, Number, Boolean…, this, super
@vuon9
vuon9 / throttled_transport.go
Created Nov 20, 2021 — forked from zdebra/throttled_transport.go
NewThrottledTransport wraps transportWrap with a rate limitter, improvement of https://gist.github.com/MelchiSalins/27c11566184116ec1629a0726e0f9af5 since it allows use of *http.Client
View throttled_transport.go
package main
import (
"net/http"
"time"
"golang.org/x/time/rate"
)
// ThrottledTransport Rate Limited HTTP Client
@vuon9
vuon9 / customs.css
Created Nov 13, 2021
BetterDiscord - make window title bar looks like the same as native app (Windows 11)
View customs.css
#app-mount .typeWindows-1za-n7 {
height: auto;
/* padding: 0px 8px 3px 5px; */
/* margin-right: 5px; */
position: relative;
z-index: 10;
box-sizing: border-box;
}
#app-mount .typeWindows-1za-n7 .winButton-iRh8-Z {
@vuon9
vuon9 / gpg_git_signing.md
Created Nov 12, 2021 — forked from alopresto/gpg_git_signing.md
Steps to enable GPG signing of git commits.
View gpg_git_signing.md

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@vuon9
vuon9 / README.md
Last active May 20, 2022
Powertoys - Keyboard Manager - Common macOS keys mapping
View README.md

How to install

  • cd C:\Users\${username}\AppData\Local\Microsoft\PowerToys\Keyboard Manager
  • Backup file existing one of default.json
  • Download default.json and add it to the current folder

Mapped keys

key
Esc
@vuon9
vuon9 / gilded-rose-original.go
Created May 14, 2021
GildedRose Refactoring Kata in Go
View gilded-rose-original.go
package main
func UpdateQualityOld(items ...*Item) {
for i := 0; i < len(items); i++ {
if items[i].name != "Aged Brie" && items[i].name != "Backstage passes to a TAFKAL80ETC concert" {
if items[i].quality > 0 {
if items[i].name != "Sulfuras, Hand of Ragnaros" {
items[i].quality = items[i].quality - 1
}
View gist:5dee7d829c8c8bb9f8007db88ea2f167
var __BUNDLE_START_TIME__ = this.nativePerformanceNow ? nativePerformanceNow() : Date.now(),
__DEV__ = false,
process = this.process || {};
process.env = process.env || {};
process.env.NODE_ENV = process.env.NODE_ENV || "production";
!(function(r) {
"use strict";
r.__r = o, r.__d = function(r, i, n) {
if (null != e[i]) return;
var o = {
@vuon9
vuon9 / slackymous.css
Last active Dec 14, 2020
Slackymous - Stylish CSS script for "URLs on the domain: app.slack.com"
View slackymous.css
body {
font-family: Arial, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.c-avatar, .c-avatar--interactive {
display: none;
}
@vuon9
vuon9 / json_extract_c.sql
Created Nov 9, 2020
JSON_EXTRACT_C func for parsing json string in mysql
View json_extract_c.sql
DELIMITER $$
DROP FUNCTION IF EXISTS `json_extract_c`$$
CREATE FUNCTION `json_extract_c`(
details TEXT,
required_field VARCHAR (255)
) RETURNS TEXT CHARSET utf8
BEGIN
SET details = TRIM(LEADING '{' FROM TRIM(details));