Skip to content

Instantly share code, notes, and snippets.

View jacmkno's full-sized avatar

jacmkno

View GitHub Profile
@jacmkno
jacmkno / Kraken Order Options.JSON
Last active January 2, 2024 07:19
Kareken Order Options
// Fields available to open a new position in kraken on a given asset
{
"Order Type": {
"Description": "Type of order for execution",
"Options": {
"Market": {
"description": "Executes at the current market price",
"fields": {}
},
"Limit": {
@jacmkno
jacmkno / Disable Youtube Shorts and Advertisement on Logo.css
Created November 20, 2023 18:05
Disable Youtube Shorts and Advertisement on Logo
ytd-reel-shelf-renderer.style-scope.ytd-item-section-renderer {}ytd-reel-shelf-renderer.style-scope.ytd-item-section-renderer {}ytd-reel-shelf-renderer.style-scope.ytd-item-section-renderer {}ytd-reel-shelf-renderer.style-scope.ytd-item-section-renderer {
display: none !important;
}
yt-icon#logo-icon:before {
content: 'Customized...';
position: absolute;
left:1em;
top:0.5em;
}
@jacmkno
jacmkno / Random 1-0 Maze matrix.js
Last active November 9, 2023 07:49
Random 1/0 Maze matrix
class RandomMazeGenerator {
constructor(rows, cols) {
this.rows = rows;
this.cols = cols;
this.maze = this.generateRandomMaze();
}
generateRandomMaze() {
const maze = new Array(this.rows);
@jacmkno
jacmkno / README.md
Last active November 3, 2023 14:11
Loan Simulator Fixed rate, Fixed Installments, Fixed Monthly Payment

Función simulateLoan

Esta función simula un préstamo y genera una tabla de amortización.

Parámetros:

  • {P}: El monto del préstamo principal.
  • {n}: El número total de períodos de amortización.
  • {rate} (opcional, valor predeterminado: 0.03): La tasa de interés por período.
  • {insurance} (opcional, valor predeterminado: 0.0012): La tasa de seguro por período.
  • {round} (opcional, valor predeterminado: false): Un booleano que indica si se deben redondear los valores en la tabla de amortización.
@jacmkno
jacmkno / cleanup.sh
Created September 1, 2023 20:26
Disk Cleanup
#!/bin/bash
# Remove files from a folder up to certain accumulated size to free up space
folder_path="/var/www/vhosts/" # Replace with the actual folder path
max_size_bytes=$((2 * 1024 * 1024 * 1024)) # 2GB in bytes
total_size=0
num_files=0
selected_files=()
max_date=""
min_date=""
@jacmkno
jacmkno / Structured Conversation
Created May 29, 2023 04:21
ChatGPT Prompt Ideas
STARTER -- Initial message.
Let's have a conversation where your answers are provided in JSON format with the following structure. Under no circumstance should you deviate from these guidelines:
1. understanding: Summarize what you think we are talking about. General Goal or Subject in a single string
2. ideas: Concepts or ideas you think to be relevant for the understanding or achieving the goal.
3. questions: List of questions you think that need to be solved in order to achieve the goal or understand the subject properly
4. answer: A short summary of you natural answer to my last message.
5. reminder: Summarize this guideline so you wont forget what we are doing.
REMINDER -- Send this every now and then or then the response starts loosing structure.
Your answers are to be provided in JSON format including the "Status for the Conversation" with the following structure. Under no circumstance should you deviate from these guidelines.
@jacmkno
jacmkno / demo-for-await-vs-promise-all.js
Last active May 11, 2022 18:23
for await vs Promise.all
a = [1,2,3,4,5,5,6,7];
op = e => new Promise(s=>setTimeout(()=>{ console.log("N:", e); s(e)}, Math.random()*1000))
do1 = async () => { await Promise.all(a.map(op)); }
do2 = async ()=>{ for await (const e of a) await op(e) }
await do1(); console.log('done');
/* OUTPUT Promise.all
N: 6
N: 5
@jacmkno
jacmkno / README.md
Last active March 11, 2022 14:27
Readme vorisoma

Vorisoma para Paco 2.0

Sistema para análisis de Redes Criminales

Esta es una aplicación web que unifica una variedad de herramientas de usuario final para facilitar el análisis de redes criminales.

Tecnologías: PHP/MySQL

Despliegue con docker-compose:

cd docker
@jacmkno
jacmkno / BashPromise.php
Last active February 25, 2023 08:42
Promises in PHP with Asyncronous Bash Execution
<?php
namespace Promises;
class BashPromise extends Promise {
public $outputTmpFile;
public $inputTmpFile;
function __construct($process, $inputData=NULL, $inputAsStdIn = FALSE){
$inputExtra = '';
if($inputData){
$this->inputTmpFile = tempnam("/tmp", "PHPBashPromiseIn");
@jacmkno
jacmkno / .env.example
Last active March 5, 2021 14:24
Docker
APP_NAME=Sourect
APP_ENV=local
APP_KEY=base64:AmZFtXskJNRgoVVlfeu5IzgCOW2L9soPAaQ8JeH3Jvg=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=sourect_mysql