Skip to content

Instantly share code, notes, and snippets.

View lil5's full-sized avatar
🇪🇺
Working from home

Lucian I. Last lil5

🇪🇺
Working from home
View GitHub Profile
@lil5
lil5 / package.json
Created September 12, 2023 08:19
Working tsconfig for nodejs
{
"type": "module",
"main": "./src/app.ts",
"scripts": {
"dev": "node --experimental-specifier-resolution=node --loader ts-node/esm src/app.ts"
},
"dependencies": {},
"devDependencies": {
"@types/node": "^20.6.0",
"ts-node": "^10.9.1",
@lil5
lil5 / startup-dev.sh
Created January 23, 2023 08:50
Quick start multiple applications from one launcher icon
#!/bin/sh
xdg-open /home/$USER/.local/share/applications/menulibre-postman-agent.desktop
xdg-open /usr/share/applications/code.desktop
xdg-open /var/lib/flatpak/app/io.dbeaver.DBeaverCommunity/current/active/export/share/applications/io.dbeaver.DBeaverCommunity.desktop
xdg-open /home/$USER/.local/share/applications/firefox.desktop
xdg-open /usr/share/applications/xfce4-terminal.desktop
@lil5
lil5 / utils.dart
Created September 23, 2021 15:16
Dart MM:SS format
class Utils {
static String timeMinutesSeconds(int totalSeconds) {
int minutes = (totalSeconds / 60).truncate();
int seconds = minutes % 60;
return "$minutes:${seconds.toString().padLeft(2, '0')}";
}
}
@lil5
lil5 / create_virtual_sink.sh
Created August 23, 2021 13:11
Create virtual audio loopback
#!/bin/sh
pacmd load-module module-null-sink sink_name=Virtual_Sink sink_properties=device.description=Virtual_Sink
@lil5
lil5 / index.ts
Last active August 4, 2021 08:23
Async function on load
async function waitDocumentLoad() {
return new Promise<void>((resolve) =>
window.addEventListener("load", () => resolve())
)
}
@lil5
lil5 / http-error.go
Created June 24, 2021 09:25
Http Error handeling with GoLang Gin
package tools
import (
"net/http"
"github.com/gin-gonic/gin"
)
type HttpErr struct {
Err error
@lil5
lil5 / .bashrc.part
Created May 5, 2021 09:41
Bash with branch
# with color prompt
PS1="\[\033[95m\]\u@\h \[\033[32m\]\W\[\033[33m\] [\$(git symbolic-ref --short HEAD 2>/dev/null)]\[\033[00m\]\$ "
# without
PS1="\u@\h \W [\$(git symbolic-ref --short HEAD 2>/dev/null)]\$ "
@lil5
lil5 / li-woo-shortcode.php
Created March 27, 2021 16:21
Shortcode WooCommerce Product Price.
<?php
/*
Plugin Name: LI Woo Shortcode
Plugin URI: http://li.last.nl
Description: Add Product Price in WooCommerce as a Shortcode
Version: 1.0
Author: Lucian I. Last
Author URI: https://li.last.nl
License: GPL2
@lil5
lil5 / li-sitemap.php
Created March 24, 2021 12:58
Removes unwanted Wordpress sitemaps
<?php
/*
Plugin Name: LI Sitemap
Plugin URI: http://li.last.nl
Description: A very basic sitemap plugin
Version: 1.0
Author: Lucian I. Last
Author URI: https://li.last.nl
License: GPL2
@lil5
lil5 / update-repos.sh
Created November 27, 2020 07:49
Keep up to date with your backend
#!/bin/bash
dirs=("api" "api2")
for d in "${dirs[@]}"
do
pushd $d
git pull
popd
done