Skip to content

Instantly share code, notes, and snippets.

{
"json.schemas": [
],
"emmet.includeLanguages": {"erb": "html"},
"editor.rulers": [
80,
120
],
"launch": {
"configurations": [],

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@shajeen
shajeen / [python] clone all star repo
Last active May 10, 2024 18:31
Code to download all stared repo
from github import Github
from pygit2 import clone_repository
import random
import string
import json
import os
path = "/home/shajeen/Documents/git_stared/"
g = Github("git personal access token")
@davecheney
davecheney / bm_test.go
Last active May 10, 2024 18:30
Which is faster ? map[string]bool or map[string]struct{} ?
package bm
import (
"testing"
)
var mb = map[string]bool{
"alpha": true,
"beta": true,
"gamma": true,
@Annihil
Annihil / afterburner_curve_parser.py
Created May 25, 2022 02:16
MSI Afterburner VF curve parser
import struct
vfcurve = "0000020080000000000000000000E14300007F43000000000020E44300007F43000000000040E74300007F43000000000060EA4300007F43000000000080ED4300007F430000000000A0F04300007F430000000000C0F34300007F430000000000E0F64300007F43000000000000FA4300007F43000000000020FD4300007F43000000000020004400007F430000000000B0014400007F43000000000040034400007F430000000000D0044400007F43000000000060064400007F430000000000F0074400007F430000000000800944000096430000000000100B440080AC430000000000A00C440000C3430000000000300E440000D2430000000000C00F440080E84300000000005011440000FF430000000000E0124400C00A44000000000070144400401244000000000000164400801D440000000000901744000025440000000000201944004030440000000000B01A4400803B440000000000401C44000043440000000000D01D4400404E440000000000601F4400C055440000000000F0204400006144000000000080224400806844000000000010244400C073440000000000A0254400407B440000000000302744004083440000000000C02844000087440000000000502A4400C08A440000000000E02B44006090440000000000702D44002094440000000000002F4400E097
@Klerith
Klerith / instalaciones.md
Created August 20, 2019 19:35
Curso de Dart - Instalaciones
@robskillington
robskillington / prometheus.proto
Last active May 10, 2024 18:28
Example Python Prometheus remote write client
// Copyright 2016 Prometheus Team
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@W3BGUY
W3BGUY / NetSuite Transaction Status Codes
Created August 4, 2020 19:45
List of NetSuite Transaction Status Names and Codes
Bill:Open <===> VendBill:A
Bill:Paid In Full <===> VendBill:B
Bill Payment:Voided <===> VendPymt:V
Bill Payment:Online Bill Pay Pending Accounting Approval <===> VendPymt:Z
Cash Sale:Unapproved Payment <===> CashSale:A
Cash Sale:Not Deposited <===> CashSale:B
Cash Sale:Deposited <===> CashSale:C
Check:Voided <===> Check:V
Check:Online Bill Pay Pending Accounting Approval <===> Check:Z
Commission:Pending Payment <===> Commissn:A
@soof-golan
soof-golan / Dockerfile
Last active May 10, 2024 18:24
Python + Poetry + Docker Example
FROM python:3.10 as python-base
# https://python-poetry.org/docs#ci-recommendations
ENV POETRY_VERSION=1.2.0
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
# Tell Poetry where to place its cache and virtual environment
ENV POETRY_CACHE_DIR=/opt/.cache
@happyendermangit
happyendermangit / main.css
Created April 7, 2024 19:09
whatsapp new mobile redesign for web (custom css)
/** modify voice message button color **/
button[aria-label="Voice message"] {
background-color: #21C063;
border-radius: 50px;
}
button[aria-label="Voice message"] svg {
width: 20px;
height: 20px;
}