Skip to content

Instantly share code, notes, and snippets.

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

Jef Mancera jeferandom

🏠
Working from home
View GitHub Profile
@jeferandom
jeferandom / onSpotifyAdMute.ahk
Last active September 5, 2024 00:38
Script to mute windows when it detects Spotify Advertisement on windows with autohotkey V1
; Define a flag to track the mute state
isMuted := false
; Function to mute the system volume
MuteVolume() {
Run, C:\nircmd\nircmd.exe mutesysvolume 1
}
; Function to unmute the system volume
UnmuteVolume() {
# i3 config file (v4) for Regolith Desktop Environment
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# This defines which key super maps to on your keyboard.
# Alt key is Mod1, and Windows key is Mod4
set $mod Mod4
set $alt Mod1
# i3xrocks config file
@jeferandom
jeferandom / server.js
Last active May 19, 2022 16:16
Config Swagger Express with yaml files.
const swaggerJsdoc = require("swagger-jsdoc");
const swaggerUI = require('swagger-ui-express');
const options = {
definition: {
openapi: "3.0.0",
info: {
"title": "Server Importacion",
"version": "1.0.0"
},
@jeferandom
jeferandom / nginxproxy.md
Created March 29, 2022 22:51 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@jeferandom
jeferandom / index.ts
Created March 15, 2022 23:13
basic interfaces typescript
interface SuperHeroe {
nombre: string;
edad: number;
direccion: Direccion,
mostrarDireccion: () => string
}
interface Direccion {
calle: string;
pais: string;
ciudad: string;
@jeferandom
jeferandom / valida_rut.js
Created October 25, 2021 04:36 — forked from donpandix/valida_rut.js
Valida RUT chileno con JavaScript
var Fn = {
// Valida el rut con su cadena completa "XXXXXXXX-X"
validaRut : function (rutCompleto) {
if (!/^[0-9]+[-|‐]{1}[0-9kK]{1}$/.test( rutCompleto ))
return false;
var tmp = rutCompleto.split('-');
var digv = tmp[1];
var rut = tmp[0];
if ( digv == 'K' ) digv = 'k' ;
return (Fn.dv(rut) == digv );
@jeferandom
jeferandom / config
Last active January 4, 2024 08:37
my i3 config file, custom workspaces
# i3 config file (v4) for Regolith Desktop Environment
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# This defines which key super maps to on your keyboard.
# Alt key is Mod1, and Windows key is Mod4
set $mod Mod4
set $alt Mod1
# i3xrocks config file
@jeferandom
jeferandom / WebViewCustomCss.js
Last active November 24, 2021 06:07
Hide element class name on webview React Native
import React, {useEffect} from 'react';
import { WebView } from 'react-native-webview';
export default function OrderReviewScreen() {
const runFirst = `
document.getElementsByClassName('main-header')[0].style.display = 'none';
true; // note: this is required, or you'll sometimes get silent failures
`;
return (
<>