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 / ps_get_win_reboot_reasons.md
Last active March 13, 2025 18:49
Get latest Windows reboot reasons

List latest Windows reboots and its causes

$rebootEvents = Get-WinEvent -FilterHashtable @{
    LogName = 'System'
    ID = 1074, 6008
} -MaxEvents 10 | Sort-Object TimeCreated -Descending

$rebootEvents | ForEach-Object {
 $event = $_
@yordanoweb
yordanoweb / current_dir_size.md
Created February 14, 2025 13:30
Current dir size in PowerShell

Current directory size in PowerShell

$size = (Get-ChildItem -Path . -Recurse -File | Measure-Object -Property Length -Sum).Sum
Write-Output "Directory size: $([math]::Round($size / 1MB, 2)) MB"

If you want everything in one line:

@yordanoweb
yordanoweb / tradingview_ta.md
Last active January 13, 2025 20:00
TradingView TA with Python

TradingView TA with Python module

Install

pip install tradingview_ta

The code

SSH to VPS from GitHub actions

SSH Key: Generate an SSH key pair if you don't have one:

ssh-keygen -t rsa -b 4096 -C "[email protected]"

Copy the public key to your VPS:

@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