A Pen by Nenad Kaevik on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Type alias for a promise of type T. | |
*/ | |
type ToIn<T> = Promise<T>; | |
/** | |
* Type alias for a function that can optionally be executed after the promise resolves or rejects. | |
* It can return void or a Promise that resolves to void. | |
*/ | |
type ToFinally = () => void | Promise<void>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { readFile, writeFile } from "fs/promises"; // Use promises version of fs methods | |
import { execSync } from "child_process"; | |
import chalk from "chalk"; //chalk commonJs | |
import type { ForegroundColorName, BackgroundColorName } from "chalk"; | |
type Msg = [string, ForegroundColorName | "white", BackgroundColorName | null]; | |
// Define the package semver and app version | |
const packageSemver = "3.0.5"; // Replace with your desired package semver | |
const appVersion = "1.8.4"; // Replace with your desired app version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createPinia, defineStore } from "pinia"; | |
import { ref, type Ref, type UnwrapRef } from "vue"; | |
const pinia = createPinia(); | |
export const newStore = <T>(storeName: string, value: T) => { | |
const start = defineStore(storeName, () => { | |
const state = ref(value); | |
function update(newValue: UnwrapRef<T>) { | |
state.value = newValue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--------|[ Useful Commands ]|--------# | |
function useful_commands | |
# Set the commands file path as a universal variable so it's accessible in preview | |
set -x commands_file "$HOME/lorens_linux_config/zsh/usefull_commands.txt" | |
set header "CommandsList" | |
# Define fzf options as an array | |
set fzf_cool \ | |
--reverse \ | |
--pointer="➜" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--------|[ Useful Commands ]|--------# | |
function useful_commands() { | |
# You need to export $commands_file so it can be accessible inside the preview shell | |
# Or use the full path instead of the variable | |
declare -x commands_file="${HOME}/lorens_linux_config/zsh/usefull_commands.txt" | |
header="CommandsList" | |
fzf_cool=( | |
--reverse | |
--pointer="➜" | |
--info=inline-right |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--------|[ Explorer ]|--------# | |
e(){ | |
if [ -z $1 ]; then | |
nautilus . | |
else | |
nautilus $1 | |
fi | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* selected file list item */ | |
.part.sidebar.right.pane-composite-part { | |
border: none !important; | |
} | |
.monaco-workbench .part > .content { | |
width: 100% !important; | |
} | |
/* comments */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nav class="amazing-tabs"> | |
<div class="filters-container"> | |
<div class="filters-wrapper"> | |
<ul class="filter-tabs"> | |
<li> | |
<button class="filter-button filter-active" data-translate-value="0"> | |
New | |
</button> | |
</li> | |
<li> |
A Pen by Stas Melnikov on CodePen.
NewerOlder