Skip to content

Instantly share code, notes, and snippets.

View wilyJ80's full-sized avatar
πŸ’­
πŸͺ

Victor Hugo wilyJ80

πŸ’­
πŸͺ
View GitHub Profile
@wilyJ80
wilyJ80 / post-install.sh
Created February 8, 2024 18:10
My post install for Debian LXQt
sudo apt update && sudo apt upgrade
sudo apt install openssh-client git htop \
sdd-theme-debian-maui
@wilyJ80
wilyJ80 / vscode-gcc-mingw.bat
Last active March 19, 2024 01:20
c-vscode-mingw-gcc-quickstart
@echo off
winget install -e --id Microsoft.VisualStudioCode
winget install -e --id MSYS2.MSYS2
C:\msys64\msys2_shell.cmd -c "pacman -Syu"
C:\msys64\msys2_shell.cmd -c "pacman -Su"
C:\msys64\msys2_shell.cmd -c "pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain"
setx PATH "%PATH%;C:\msys64\usr\bin"
@wilyJ80
wilyJ80 / nginx.conf
Last active May 24, 2024 18:08
Lapis Nginx Config production notes
worker_processes ${{NUM_WORKERS}};
# Toggle in production
error_log stderr notice;
# Toggle in production
daemon off;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
@wilyJ80
wilyJ80 / Dockerfile
Last active June 4, 2024 10:31
Lapis Framework Dev Container
FROM alpine:3.12
LABEL org.opencontainers.image.source="https://github.com/MilesChou/docker-lapis" \
repository="https://github.com/MilesChou/docker-lapis" \
maintainer="MilesChou <github.com/MilesChou>"
# Ref https://github.com/openresty/docker-openresty/blob/master/alpine/Dockerfile
ARG OPENRESTY_CONFIG_OPTIONS="\
--with-http_auth_request_module \
--with-http_gunzip_module \
@wilyJ80
wilyJ80 / sort-words.py
Last active May 31, 2024 20:59
Python word sorter: multi-file, supports subdirectories, no loops
#!/usr/bin/env python3
# Sorts words each on its own line, on any number of files
from pathlib import Path
import timeit
def sorter():
files = list(filter(lambda x: x.is_file(), Path('.').rglob('*')))
@wilyJ80
wilyJ80 / script.md
Last active June 18, 2024 15:59
plasticome notes

Plasticome Docker ArchLinux

  • install python3.10

  • TODO: Install correct python version

pacman -Sy python3 --noconfirm

  • Create user, to use yay
@wilyJ80
wilyJ80 / error.md
Created August 23, 2024 23:10
bem server error
 βœ” Network bem-server_backend  Created                                                                                                                                  0.1s 
 βœ” Container pgsql             Created                                                                                                                                  0.1s 
 βœ” Container bem-server        Created                                                                                                                                  0.0s 
 βœ” Container nginx-bem-server  Created                                                                                                                                  0.1s 
Attaching to bem-server, nginx-bem-server, pgsql
pgsql             | The files belonging to this database system will be owned by user "postgres".
pgsql             | This user must also own the server process.
pgsql             | 
pgsql             | The database cluster will be initialized with locale "en_US.utf8".
@wilyJ80
wilyJ80 / regex.sh
Created August 26, 2024 22:07
Exercicio 1 regex
#!/bin/bash
test_words() {
local pattern=$1
shift
local words=("$@")
for word in "${words[@]}"
do
if ! echo "$word" | grep -E "$pattern" > /dev/null ; then
@wilyJ80
wilyJ80 / auto.dot
Created September 3, 2024 13:46
Automata: even number of as and bs
/* Automato finito: w possui um numero par de a e b */
digraph {
zero;
one;
two;
node [shape="doublecircle"];
three;
/* estado inicial */
@wilyJ80
wilyJ80 / regex.js
Created September 18, 2024 19:10
js multiline regex with comments?
const pattern = new RegExp([
'\\d{3}', // Area code
'\\s*', // Optional whitespace
'-?', // Optional dash
'\\d{4}' // Main number
].join(''), 'g');
const match = '123 4567'.match(pattern);
console.log(match[0]); // "123 4567"