Skip to content

Instantly share code, notes, and snippets.

View rogeruiz's full-sized avatar
🚧
socorro, estoy en cavado en el internet

Roger Steve Ruiz rogeruiz

🚧
socorro, estoy en cavado en el internet
View GitHub Profile
@rogeruiz
rogeruiz / demo.ts
Created December 22, 2024 13:32 — forked from vedantroy/demo.ts
SQLite-backed key-value store with JS-like object manipulation and automatic JSON serialization.
import Database from 'better-sqlite3';
import { createDatabaseClient } from 'my-partial-db-lib';
// 1) Create an in-memory DB and your table(s).
const db = new Database(':memory:');
db.exec(`
CREATE TABLE users (
id TEXT PRIMARY KEY,
data JSON
);
@rogeruiz
rogeruiz / game.sh
Created October 13, 2024 23:11
Word Guess IT game Sept 20 2023
#!/bin/bash
# 1. Find out the number of words in the word file
number_of_words=$(wc -l < ./word-list.txt)
# 2. Pick a random word from the list
pick_random_number=$((1 + RANDOM % number_of_words))
# 3. Pick the line from the word list that is the random number
the_word=$(sed "${pick_random_number}q;d" ./word-list.txt)
@rogeruiz
rogeruiz / fijar_tema.ps1
Last active December 13, 2024 19:24
Es útil pa' cambiar varias configuraciones de varias aplicaciones usando PowerShell.
$luna = [char]::ConvertFromUtf32(0x1F31D)
$sol = [char]::ConvertFromUtf32(0x1F31E)
$murcielago = [char]::ConvertFromUtf32(0x1F987)
$nota = [char]::ConvertFromUtf32(0x1F4DD)
$cohete = [char]::ConvertFromUtf32(0x1F680)
$concha = [char]::ConvertFromUtf32(0x1F41A)
$error = [char]::ConvertFromUtf32(0x274C)
$marco = [char]::ConvertFromUtf32(0x1F5BC)
$exito = [char]::ConvertFromUtf32(0x2705)
@rogeruiz
rogeruiz / nowplaying-cli.sh
Created September 9, 2024 20:15
This is an example script that uses `nowplaying-cli` to extract things without needing `jq`
#!/bin/bash
generic_prefix='kMRMediaRemoteNowPlayingInfo'
apple_prefix='MRMediaRemoteMediaType'
# Requires Bash 4+ due to associative array usage in this script.
declare -A npc_response=(
[artist]='null'
[title]='null'
[album]='null'
@rogeruiz
rogeruiz / XDG.cheat-sheet.md
Created February 24, 2024 00:34 — forked from roalcantara/XDG.cheat-sheet.md
XDG cheat sheet

XDG - Base Directory Specification

Directories

Base

The intended use-case for BaseDirectories is to query the paths of user-invisible standard directories that have been defined according to the conventions of the operating system the library is running on.

@rogeruiz
rogeruiz / gruvbox-material-alacritty.yml
Created September 19, 2023 13:05 — forked from ttys3/gruvbox-material-alacritty.yml
Gruvbox Material for Alacritty
# The definition of color schemes.
schemes:
gruvbox_material_hard_dark: &gruvbox_material_hard_dark
primary:
background: '0x1d2021'
foreground: '0xd4be98'
normal:
black: '0x32302f'
red: '0xea6962'
green: '0xa9b665'
@rogeruiz
rogeruiz / macos-tmux-256color.md
Created April 21, 2023 20:11 — forked from bbqtd/macos-tmux-256color.md
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@rogeruiz
rogeruiz / readme.md
Created January 22, 2023 23:03 — forked from eddiewebb/readme.md
Hugo JS Searching with Fuse.js
@rogeruiz
rogeruiz / dms_nonmasteruser.sql
Last active October 7, 2022 19:07
AWS DMS NonMasterUser documentation revisted
-- ███████╗██████╗ ██████╗ ███╗ ███╗ ████████╗██╗ ██╗███████╗
-- ██╔════╝██╔══██╗██╔═══██╗████╗ ████║ ╚══██╔══╝██║ ██║██╔════╝
-- █████╗ ██████╔╝██║ ██║██╔████╔██║ ██║ ███████║█████╗
-- ██╔══╝ ██╔══██╗██║ ██║██║╚██╔╝██║ ██║ ██╔══██║██╔══╝
-- ██║ ██║ ██║╚██████╔╝██║ ╚═╝ ██║ ██║ ██║ ██║███████╗
-- ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝
--
-- ██████╗ ███████╗███████╗██╗ ██████╗██╗ █████╗ ██╗ █████╗ ██╗ ██╗███████╗
-- ██╔═══██╗██╔════╝██╔════╝██║██╔════╝██║██╔══██╗██║ ██╔══██╗██║ ██║██╔════╝
-- ██║ ██║█████╗ █████╗ ██║██║ ██║███████║██║ ███████║██║ █╗ ██║███████╗
@rogeruiz
rogeruiz / log.txt
Created September 7, 2022 03:27
running a Nix update on Intel Mac with BitDefender enabled
replacing old 'mymove-packages'
installing 'mymove-packages'
these derivations will be built:
/nix/store/caqw0jcbw909zkx3j5lqwwa4ssnsdvrx-mymove-packages.drv
these paths will be fetched (37.58 MiB download, 169.98 MiB unpacked):
/nix/store/0xk767wa16miwacy3yq2jh10qb4f06x3-curl-7.84.0
/nix/store/1d11rh5gv8r7940f17m6fgybxpr9n73j-bzip2-1.0.6.0.2
/nix/store/1m3xkxfri4lwlnkhgkxgl2flcvf3s669-python3.10-platformdirs-2.5.2
/nix/store/337wr623s6x4vkizbkaljiq9iqws11jn-zlib-1.2.12
/nix/store/3gngv4wgnj0hvidfz1cfahzh2c3qn6yi-sqlite-3.39.0