Skip to content

Instantly share code, notes, and snippets.

View t18n's full-sized avatar
🔥
Learning and building

Turbo Ninh t18n

🔥
Learning and building
View GitHub Profile
@t18n
t18n / nickel-config
Last active November 8, 2026 07:36
My NickelMenu configuration for Kobo Libra 2 (or any other)
##########################################
######## NickelMenu configuration ########
##########################################
#
## Main Menu
#
menu_item : main : Pocket : nickel_open: library : pocket
menu_item : main : Browser (full window) : nickel_browser :
menu_item : main : Browser (popup) : nickel_browser : modal
@t18n
t18n / tsconfig.json
Last active December 11, 2025 20:14 — forked from vemarav/tsconfig.json
[Example tsconfig.json] Tsconfig.json with description #typescript
{
"compilerOptions": {
/* Basic Options */
"target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
"lib": [
"esnext",
"dom"
] /* Specify library files to be included in the compilation. */,
// "allowJs": true, /* Allow javascript files to be compiled. */
@t18n
t18n / config.ts
Created October 29, 2024 12:27
Simple environment variable validation with Zod
import 'dotenv/config';
import { z } from 'zod';
/*
* By default, the zod library will throw an error if the environment variable is missing.
* All environment variables are string by default.
* */
function zodEnvCheck(value: string) {
return z.string({ message: `Environment variable missing: ${value}` }).parse(process.env[value]);
}
@t18n
t18n / docker-compose.yml
Created October 18, 2024 12:33
Postgres DB local docker-compose.yml
version: '3.9'
services:
db:
# Docs: https://hub.docker.com/_/postgres
image: postgres:16.4-alpine3.20
restart: always
# Drizzle postgresql://myuser:Secret@1234@localhost:5432/mydb
environment:
- POSTGRES_USER=myuser
@t18n
t18n / sync-models.sh
Created June 17, 2024 10:23
A script that allow to sync ollama models between computers. Useful for dotfiles backups
#!/bin/bash
# Create a list of existing Ollama models
existingModels=$(ollama list | awk '{if(NR>1) print $1}')
# Create a list of Ollama models to pull
models=(
llama3:8b
phi3:mini
phi3:medium
@t18n
t18n / repro.lua
Created June 10, 2024 09:21
Lazy.nvim repro template
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
@t18n
t18n / Tmux Cheatsheet.md
Last active November 9, 2020 13:11
[Tmux Basic Cheatsheet] Basic commands to use in Tmux #tmux #shell #tool

‎# Tmux Basic Cheatsheet

Bash Session

These commands are to use in Bash, not inside a tmux session

  • Show all sessions: tmux ls
  • Attach to session: tmux attach -t <session-name>
  • Create new session: tmux new -s <session-name>
  • Kill session: tmux kill-session -a -t <session-name>

Session

@t18n
t18n / vim-cheatsheet.md
Last active September 15, 2020 13:19
[VIM] Vim cheatsheet #vim #ide #editor #programming-tool

VIM cheetsheets

General

  • .: Repeat last command

Moving Cursor with Word

  • e: Move to end of word
  • w: Move to beginning of word (prepend number to specify how many word)
  • W: Move forward a WORD, any non-whitespace characters (prepend number to specify how many word)
  • b: Move backward to the beginning of a word. (prepend number to specify how many word)
@t18n
t18n / generate-site-map.js
Last active May 19, 2020 19:32
[Generate sitemap with sitemap-generator] Javascript snippet for generating sitemap with sitemap-generator #javascript
// Install sitemap-generator first
const SitemapGenerator = require('sitemap-generator');
// create generator
var generator = SitemapGenerator('http://localhost:8080/', {
maxDepth: 10,
filepath: 'src/sitemap.xml',
maxEntriesPerFile: 50000,
stripQuerystring: true
@t18n
t18n / Vagrant CentOS LAMP - PHP7.bash
Last active May 19, 2020 19:31
[Vagrant CentOS LAMP - PHP7] Vagrant CentOS LAMP stack #vagrant #php #lamp
#!/bin/bash
# Update CentOS with any patches
sudo yum update -y --exclude=kernel
# Tools
sudo yum install -y nano unzip screen wget
# Apache 2
sudo yum install -y httpd httpd-devel httpd-tools