Skip to content

Instantly share code, notes, and snippets.

View yordanoweb's full-sized avatar
💭
I may be slow to respond.

Yordano Pascual Rivera yordanoweb

💭
I may be slow to respond.
  • Freelancer
  • Las Tunas, Cuba
View GitHub Profile
@yordanoweb
yordanoweb / identity_monad.md
Last active January 13, 2025 19:48
Identity monad implemented in Go

Identity Monad in Go

package main

import (
	"fmt"
	"reflect"
)
@yordanoweb
yordanoweb / tradingview_ta_json.md
Last active January 13, 2025 19:49
TradingView Technical Analysis JSON

TradingView Analysis Indicators Raw Request

#!/bin/sh

# Pass one and only one symbol, ok? 
symbol=$(echo $1 | tr '[:lower:]' '[:upper:]')

base_url="https://scanner.tradingview.com/symbol"
indicators=""
@yordanoweb
yordanoweb / png_from_pandas_df.md
Last active January 13, 2025 19:45
Create a PNG table image from a Pandas Dataframe

PNG from Pandas Dataframe

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd


data = {'  A  ': [0, 0, 0.012, 0, 0, 0, 0],
        '  B  ': [0.1, 0, 0.035, 0.12, 0, 0, 0],
@yordanoweb
yordanoweb / pre-commit-golang.md
Created April 6, 2024 22:32
Prepare Golang project for pre-commit

Steps to prepare a Golang project for pre-commit stuff

sudo pamac install pre-commit
sudo npm install -g @commitlint/cli @commitlint/config-conventional
vi /root/golang/project/commitlint.config.js
// /root/golang/project/commitlint.config.js

LUA config with some helpers for LunarVim

local lspconfig = require('lspconfig')

-- Detect if in a Go project
local function is_go_project()
  local go_files = vim.fn.globpath(vim.fn.getcwd(), '*.go', true, true)
 local go_mod_file = vim.fn.findfile('go.mod', vim.fn.getcwd())
@yordanoweb
yordanoweb / cmd-brightness.md
Last active January 30, 2024 02:30
Reduce or increase laptop display brightness from command line

Reduce or increase laptop display brightness from command line

Note: Recently my Archlinux distro stop responding to the shortcut Fn+F3 and Fn+F4 for screen brightness adjustment. Then I found this solution at: https://www.ejmastnak.com/tutorials/arch/backlight/.

First, find out the value of your laptop.

cat /sys/class/backlight/intel_backlight/brightness
@yordanoweb
yordanoweb / find-exec-package.md
Created January 24, 2024 16:00
Find the package of executable with Pacman

Find the package of executable

pacman -Qo executable_name_without_path

For example:

@yordanoweb
yordanoweb / fix-dirty-ntfs.md
Created January 17, 2024 16:11
Fix dirty NTFS disk from Linux

Fix dirty NTFS disk from Linux

The problem

Sometimes when try to mount an NTFS disk in Linux, you get at journalctl the error:

ene 17 10:52:55 hp3nvyl17 kernel: ntfs3: sda1: It is recommened to use chkdsk.
ene 17 10:52:55 hp3nvyl17 kernel: ntfs3: sda1: volume is dirty and "force" flag is not set!
@yordanoweb
yordanoweb / get-control-resolve.conf.md
Last active July 21, 2024 19:38
Get full control of resolv.conf

Get full control of resolv.conf

Edit NetworkManager.conf

Open /etc/NetworkManager/NetworkManager.conf and add:

[main]
dns=none
@yordanoweb
yordanoweb / go-win-from-linux.md
Last active February 23, 2025 16:23
Compile Go for Windows from Linux

Compile to Windows executable from Linux

Install zig

By any means, using default distro package manager, or any other method, install zig. Please, install zig first...

Compile project

CGO_ENABLED=1 \