Skip to content

Instantly share code, notes, and snippets.

View gbrls's full-sized avatar
🏴‍☠️
da lama ao caos

Gabriel Schneider gbrls

🏴‍☠️
da lama ao caos
View GitHub Profile
@gbrls
gbrls / hello.txt
Created December 15, 2023 21:54
esolang test
This language process each line as an unit.
╔══╗ ╔══╗ This line will push 2 and 2 to the stack.
╚══╝ ╚══╝
╔══╗ ╔══╗ This line will push again.
║«0--0» ║ This will take 4 elements out of the stack, multiply them and put them back.
╚══╝ ╚══╝
╔══╗ ╔══╗ This will push 2 and 2...
╚══╝ ╚══╝
«00» This will take two elements out of the stack, and multiply them.
«()» ╔══╗ This line will take two elements out of the stack, multiply them, push the result and then push 2 to the stack
@gbrls
gbrls / scaffold.sh
Created July 14, 2023 14:11
scaffold for bash scripts
#!/usr/bin/env bash
log() {
printf "(~) $1\n" 1>&2
}
if [[ -z "$1" ]]; then
log "Usage $0 ..."
exit 1
fi
@gbrls
gbrls / init.lua
Created February 25, 2022 23:51
latest init lua 25 feb 2022
-- Install packer
local execute = vim.api.nvim_command
local install_path = vim.fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
execute('!git clone https://github.com/wbthomason/packer.nvim '.. install_path)
end
-- vim.api.nvim_exec([[
@gbrls
gbrls / init.lua
Created February 6, 2022 23:12
my messy neovim config
-- Install packer
local execute = vim.api.nvim_command
local install_path = vim.fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
execute('!git clone https://github.com/wbthomason/packer.nvim '.. install_path)
end
-- vim.api.nvim_exec([[
@gbrls
gbrls / main.py
Created October 10, 2021 02:28
Record audio and copy it to clipboard
#!/bin/python3
import os, subprocess
source = 'alsa_output.pci-0000_00_1f.3.analog-stereo' # Got this from pw-cli
path = '/tmp/record.wav'
timeout = 60
trim = '00.500'
record_cmd = f'timeout {timeout} parecord --channels=1 -d {source} {path}'
@gbrls
gbrls / Makefile
Last active August 16, 2021 20:16
Makefile para projeto em raylib
#**************************************************************************************************
#
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
#
# Copyright (c) 2013-2019 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty. In no event
# will the authors be held liable for any damages arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose, including commercial
@gbrls
gbrls / game.h
Created August 8, 2021 02:56
Handmade hero hot reloading with sdl and linux
#define Kilobytes(x) ((x)*1024LL)
#define Megabytes(x) (Kilobytes(x)*(1024LL))
#define Gigabytes(x) (Megabytes(x)*(1024LL))
#define Terabytes(x) (Gigabytes(x)*(1024LL))
#define u8 unsigned char
#define u32 unsigned int
struct game_memory {
@gbrls
gbrls / main.py
Created June 3, 2021 02:44
bot zipzop
import os, time, datetime, random
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
img_src = 'blob:https://web.whatsapp.com/4227946a-7a10-47e5-8128-96bead7c0b87'
msg_opt = ['opa', 'chega mais', 'Opa', 'lansa a braba', 'pode mandar', 'manda','opa']
random.seed(datetime.datetime.now())
@gbrls
gbrls / main.rs
Created December 25, 2020 21:31
Parser combinator examples in Rust using Nom
/// This is a small program to show how to use nom v6 crate to create parsers
/// and how to implement precedence with a parser combinator library.
/// Useful resources:
/// Nom's reference: https://docs.rs/nom/6.0.1/nom/index.html
/// 'Parsing with Nom' section of Gentle rust intro: https://stevedonovan.github.io/rust-gentle-intro/nom-intro.html (it uses an outdated version of nom)
/// Nom's github documentation: https://github.com/Geal/nom/blob/master/doc/making_a_new_parser_from_scratch.md
/// combinators explanations: https://github.com/Geal/nom/blob/master/doc/choosing_a_combinator.md
use nom::{character::complete::digit1, IResult};
use std::str::FromStr;
#include <bits/stdc++.h>
#define ii pair<int,int>
using namespace std;
const int N = 1e5+20;
int n,m;
vector<int> adj[N];
ii dist[N];
int i;