Skip to content

Instantly share code, notes, and snippets.

View marcelofern's full-sized avatar
🏠
Working from home

Marcelo marcelofern

🏠
Working from home
View GitHub Profile
@marcelofern
marcelofern / map.c
Created December 8, 2023 09:55
map.c
#include "array.c"
#include <stddef.h>
#include <stdint.h>
// Must be a prime number.
#define MAP_SIZE 1009
// Another prime number, but less than MAP_SIZE.
#define MAP_PRIME 31
typedef struct map_item {
@marcelofern
marcelofern / scrapper.js
Created June 3, 2023 21:54
Nova ro market scrapper
const BASE_URL = 'https://www.novaragnarok.com/?module=vending&action=item&id=';
let table = $("table#itemtable").DataTable();
let data = table.rows().data();
let ITEMS = {};
for (let i = 0; i < data.length; i++) {
let item_id = data[i][1];
let quantity = data[i][4];
@marcelofern
marcelofern / cl_reader.c
Created May 30, 2021 05:05
Command line output reader
#define _POSIX_C_SOURCE 2 // to allow popen and pclose.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct cl_reading {
char **output;
int malloc_error;
int n_lines;
int pclose_error;
@marcelofern
marcelofern / useful_postgres_queries.sql
Created July 24, 2019 01:37
Useful postgres queries
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@marcelofern
marcelofern / arch-linux.md
Last active February 6, 2019 03:24
Arch Linux installation

Marlu - Archlinux Environment

This is just a repo to save my whole OS environment configuration. Feel free to use it if you want, there's nothing super fancy about it, if you follow through the installation process you should be able to have the very same environment as me.

Requirements:

OS: Arch linux 2019.01.01

RAM (Recommended): 4GB