Skip to content

Instantly share code, notes, and snippets.

@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active April 26, 2024 13:06
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@shuson
shuson / description-mysql_weakly-referenced object
Last active April 26, 2024 13:04
weakly-referenced object when connect to mysql in python
I came across this issue using the following code file
the error message is ReferenceError: weakly-referenced object no longer exists
reason is in the mysql/connector/cursor.py file
see these lines:
def _set_connection(self, connection):
"""Set the connection"""
try:
const title_text = "𝗜'𝗺 𝗜𝘇𝘂𝗺𝗶...!!";
const body_text = "𝐄𝐘𝐏𝐙";
const source_url = "https://github.com/sataniceypz/Izumi-xd";
large_thumb = false; // use true for larger thumbnail
const logo = "https://i.imgur.com/4AKWozV.jpeg";
var audios = ["https://i.imgur.com/tceIGIW.mp4","https://i.imgur.com/v1bYXlb.mp4","https://i.imgur.com/cGJ1Gyi.mp4","https://i.imgur.com/6HXfyVr.mp4","https://i.imgur.com/dPjoh3s.mp4","https://i.imgur.com/pbtSy0M.mp4","https://i.imgur.com/sDwfg29.mp4","https://i.imgur.com/8vhaz82.mp4"];
// ===================================================================================
// EZRA-XD MENTION AUDIO SENDER
//
/*
Created by:- Rishi Tiwari
Website:- TrickSumo.com
Video Tutorial:- https://youtu.be/nLzC0-VaqDs
Libraries used:-
https://github.com/mobizt/Firebase-ESP8266/
@coryhouse
coryhouse / package.json
Last active April 26, 2024 13:01
Example of calling one script from another
{
"name": "npm-scripts-example",
"version": "1.0.0",
"description": "npm scripts example",
"scripts": {
"clean": "rimraf ./dist && mkdir dist",
"prebuild": "npm run clean",
"build": "cross-env NODE_ENV=production webpack"
}
}
@MaggieFero
MaggieFero / altmilkpairing.md
Created April 25, 2024 21:04
AltMilks: A Pairing Decision

As a diverse array of alt-milks continues to proliferate, I'm seeing more and more questions about "which is the best altmilk." As with nearly-any question someone might end up answering on GitHub, my answer is that it depends. Some amount depends on personal flavor preferences. I think that more of this than you might expect, though, is a matter of pairing.

Background

First, why do I have so many opinions on alt milks. I have tried all of:

  • rice milk
  • oat milk
  • sesame milk
  • walnut milk
  • macadamia nut milk
  • coconut milk
@Godofbrowser
Godofbrowser / axios.refresh_token.1.js
Last active April 26, 2024 12:57 — forked from culttm/axios.refresh_token.js
Axios interceptor for refresh token when you have multiple parallel requests. Demo implementation: https://github.com/Godofbrowser/axios-refresh-multiple-request
// for multiple requests
let isRefreshing = false;
let failedQueue = [];
const processQueue = (error, token = null) => {
failedQueue.forEach(prom => {
if (error) {
prom.reject(error);
} else {
prom.resolve(token);
@theKAKAN
theKAKAN / getDirection.js
Created February 14, 2021 17:09
Convert degrees or angles to cardinal direction
function getDirection( angle ){
// We divide it into 16 sections
let directions = ["N","NNE","NE","ENE","E",
"ESE", "SE", "SSE","S",
"SSW","SW","WSW","W",
"WNW","NW","NNW" ];
// This means, every 360 / 16 degree, there's a section change
// So, in our case, every 22.5 degree, there's a section change
// In order to get the correct section, we just need to divide
let section = parseInt( angle/22.5 + 0.5 );
@drernie
drernie / csvtomap.go
Created March 10, 2017 22:48
Golang Convert CSV Records to Dictionaries using Header Row as Keys
// CSVToMap takes a reader and returns an array of dictionaries, using the header row as the keys
func CSVToMap(reader io.Reader) []map[string]string {
r := csv.NewReader(reader)
rows := []map[string]string{}
var header []string
for {
record, err := r.Read()
if err == io.EOF {
break
}