Skip to content

Instantly share code, notes, and snippets.

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

Leonardo J. Caballero G. macagua

🏠
Working from home
View GitHub Profile
@steveholgado
steveholgado / - vuejs-sass-environment-variables.md
Created January 16, 2019 20:25
Make environment variables available as Sass variables in Vue.js

Vue.js: Environment variables in Sass

Make environment variables available as Sass variables in Vue.js.

@rsperl
rsperl / Makefile #snippet
Last active April 3, 2025 14:04
self-documenting makefile with colors
SHELL=/bin/bash
# to see all colors, run
# bash -c 'for c in {0..255}; do tput setaf $c; tput setaf $c | cat -v; echo =$c; done'
# the first 15 entries are the 8-bit colors
# define standard colors
ifneq (,$(findstring xterm,${TERM}))
BLACK := $(shell tput -Txterm setaf 0)
RED := $(shell tput -Txterm setaf 1)
@aek
aek / template-rare-inheritance.xml
Last active June 5, 2020 04:25
Example of an Odoo Template XML rewrite using rare and non-documented inheritance extension
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="recommended_products_ext" inherit_id="website_sale.recommended_products">
<xpath expr="." position="replace">
<t name="Product" t-name="website_sale.recommended_products">
<xpath expr="//div[@id='product_small_description']" position="before">
<div class="container mt32" t-if="product.alternative_product_ids">
<h3>Alternative Products:</h3>
<div class="row mt16" style="">
@variux
variux / imc.py
Created September 15, 2018 17:59
Calculo del IMC para curso de Python Basico
#Aqui es donde obtenemos la cantidad de personas
personas = int(input( "personas: "))
#Aqui verificamos que la cantidad sea mayor a 0 si no, no tiene sentido pedir nada
while personas > 0:
#Le pedimos el nombre y lo guardamos en un input (Si usara Python 2.7 seria raw_input y no input pero usa python 3.7)
n = input("Su nombre por favor: ")
#Se pide al edad que siempre es un entero por eso el int()
e = int(input("Su edad en años por favor: "))
#como la altura es en metros y no centimetros hay que ponerle punto y por ende es un flotante float()
@SalahHamza
SalahHamza / install_ngrok.md
Last active May 2, 2025 02:57
How to install ngrok on linux subsystem for windows
@blaggacao
blaggacao / migration.py
Last active January 28, 2023 15:40
Odoo Migration Utils
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
import imp
import json
import logging
import os
import re
import sys
# vim: ft=python
SQLALCHEMY_DATABASE_URI = 'postgresql:///indico'
BASE_URL = 'https://YOURHOSTNAME.cern.ch'
DEBUG = True
# DISABLE_CELERY_CHECK = False
DB_LOG = True
SMTP_USE_CELERY = False
ROUTE_OLD_URLS = True
@jreyes
jreyes / node.sh
Created May 20, 2018 08:07
Instalar Node.js 10 en Ubuntu 18.04
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install nodejs
node -v
npm -v
@dublado
dublado / fail2ban-commands.md
Last active May 11, 2022 21:36
Fail2ban useful commands
cmd Description
service fail2ban restart restart fail2ban service (after edit configuration)
fail2ban-client reload restart fail2ban client
fail2ban-client status get list activated jail
fail2ban-client status
example: fail2ban-client status wplogin
example: fail2ban-client status sshd
get status (the number of unsuccessful attempts and the list of banned IPs)
fail2ban-regex /var/lib/docker/containers//-json.log /etc/fail2ban/filter.d/wplogin.conf test regex wplogin
fail2ban-regex /var/log/auth.log /etc/fail2ban/filter.d/sshd.conf test regex sshd
fail2ban-regex “line” “failregex” test regex
fail2ban-client set unbanip manually unban IP
@althonos
althonos / setup.cfg
Last active March 4, 2024 18:08
A `setup.cfg` template for my Python projects
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c
[metadata]
name = {name}
version = file: {name}/_version.txt
author = Martin Larralde
author_email = [email protected]
url = https://github.com/althonos/{name}
description = {description}
long_description = file: README.md