Skip to content

Instantly share code, notes, and snippets.

View marianozunino's full-sized avatar
:shipit:

Mariano Zunino marianozunino

:shipit:
View GitHub Profile
@marianozunino
marianozunino / maui.cs
Created October 26, 2023 01:40
Consumir REST desde maui
using Refit;
namespace MauiApp1;
// Creamos los DTOs necesarios para poder serializar los resultados de la api
public class TodoDto
{
public long Id { get; set; }
public string Title { get; set; }
}
@marianozunino
marianozunino / calc.js
Created October 20, 2023 23:18
Calculadora
const readline = require("readline");
// TODO: que es stdin y stdout?
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
function add(a, b) {
return a + b;
@marianozunino
marianozunino / php
Last active October 18, 2023 18:09
const startTime = process.hrtime();
const size = 10_000_000;
// create a real array
const numbers = new Int32Array(10_000_000); // Array no es realmente un array
for (let i = 0; i < 10_000_000; i++) {
numbers[i] = i + 1;
}
package main
import (
"archive/zip"
"bufio"
"fmt"
"io"
"os"
"runtime"
"time"
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/explicit-function-return-type */
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import { Model, Page, QueryBuilder } from 'objection';
type Options = {
columnName?: string;
@marianozunino
marianozunino / inedx.js
Last active December 13, 2021 20:09
Refactor me
function fetchImage(name, callback) {
setTimeout(() => {
var fail = Math.random() >= 0.7;
if (fail) {
callback("ERROR AL OBTENER " + name, undefined);
} else {
callback(undefined, name);
}
}, 1000);
}
@marianozunino
marianozunino / argon.sh
Last active December 22, 2024 21:04
Install argon openwrt
#!/bin/sh
opkg install luci-compat
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v2.2.9/luci-app-argon-config_0.9-20210309_all.ipk -O luci-app-argon-config_0.9-20210309_all.ipk
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v2.2.9/luci-theme-argon_2.2.9-20211016-1_all.ipk -O luci-theme-argon_2.2.9-20211016-1_all.ipk
opkg install luci-*.ipk
@marianozunino
marianozunino / psql-with-gzip-cheatsheet.sh
Created February 17, 2019 19:58 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
dd if=/dev/zero of=/swapfile bs=1024 count=10485760 #10G
#Setup the swap file with the command:
mkswap /swapfile
#correcto permissions
chmod 600 /swapfile
#To enable the swap file immediately but not automatically at boot time:
#first the repos
void-repo-multilib void-repo-multilib-nonfree
#packages
ConsoleKit2 GConf alsa-utils base-devel cantarell-fonts compton culmus dejavu-fonts-ttf dunst feh figlet file-roller flameshot font-adobe-{75,100}dpi font-awesome font-inconsolata-otf font-unifont-bdf fontconfig fontconfig-32bit fontconfig-devel freetype fzf git gnome-keyring gnupg google-fonts-ttf gotop gst-libav htop i3-gaps keychain libX11-devel libXScrnSaver libXft-devel libavcodec-32bit libavformat-32bit libavresample-32bit libavutil-32bit liberation-fonts-ttf libgnome-keyring libjpeg-turbo libjpeg-turbo-devel libpulseaudio-32bit libtxc_dxtn-32bit libv8-32bit lshw lxappearance lxrandr mate-power-manager neofetch neovim nodejs nss numlockx pavucontrol pcmanfm polybar pulseaudio python-distutils-extra python-neovim python-pip python3-devel python3-distutils-extra python3-neovim python3-pip python3-setuptools ranger rofi ruby tar tmux unzip w3m w3m-img wget xdg-utils xdpyinfo xf86-video-intel xorg xorg-minimal xset xss-lock yarn youtub