Skip to content

Instantly share code, notes, and snippets.

/**
* 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>;
@lorens-osman-dev
lorens-osman-dev / bump.ts
Created March 18, 2025 01:59
typeScript file to bump version
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
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;
@lorens-osman-dev
lorens-osman-dev / useful_commands.fish
Created November 11, 2024 01:25
fish useful commands
#--------|[ 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="➜" \
@lorens-osman-dev
lorens-osman-dev / useful_commands.sh
Created October 23, 2024 19:39
Manage your favorite terminal commands
#--------|[ 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
#--------|[ Explorer ]|--------#
e(){
if [ -z $1 ]; then
nautilus .
else
nautilus $1
fi
}
/* selected file list item */
.part.sidebar.right.pane-composite-part {
border: none !important;
}
.monaco-workbench .part > .content {
width: 100% !important;
}
/* comments */
@lorens-osman-dev
lorens-osman-dev / index.html
Created December 4, 2022 19:05
Jello Tab Bar (Animated)
<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>
@lorens-osman-dev
lorens-osman-dev / css-timeline-with-custom-properties.markdown
Created December 4, 2022 01:59
CSS Timeline with Custom Properties