Skip to content

Instantly share code, notes, and snippets.

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

Rigoberto L. Salgado Reyes Rigo85

🏠
Working from home
  • Digevo
  • Trujillo - Perú
View GitHub Profile
@Rigo85
Rigo85 / font-stacks.css
Created August 12, 2017 19:42 — forked from don1138/font-stacks.css
CSS Modern Font Stacks
/* Modern Font Stacks */
/* System */
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
/* Times New Roman-based serif */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
/* A modern Georgia-based serif */
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
@Rigo85
Rigo85 / create-bot-user.js
Created October 30, 2017 20:38
Create user on Intercom
'use strict';
const token = '<PUT TOKEN HERE>';
var Intercom = require('intercom-client');
var client = new Intercom.Client({ token: token });
//this return a promise.
client.users.create({
user_id: 0,
@Rigo85
Rigo85 / notification-query.js
Last active January 18, 2018 19:53
Notification query to MongoDB
db.getCollection('apiai_responses').aggregate([
{
$match:
{
$and: [
{ 'address.bot.id': '464021083618709' },
{ 'timestamp': { $gte: '2018-01-15T15:00:00', $lte: '2018-01-15T16:00:00' } }
]
}
}
@Rigo85
Rigo85 / async_waterfall_example.js
Created June 19, 2019 06:11 — forked from dineshsprabu/async_waterfall_example.js
NodeJS Async WaterFall Example
var async = require('async');
async.waterfall(
[
function(callback) {
callback(null, 'Yes', 'it');
},
function(arg1, arg2, callback) {
var caption = arg1 +' and '+ arg2;
callback(null, caption);
@Rigo85
Rigo85 / redis_cheatsheet.bash
Created June 21, 2019 20:44 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@Rigo85
Rigo85 / dni_peru_validate.js
Created May 9, 2020 21:57 — forked from lgaticaq/dni_peru_validate.js
Función para validar DNI Peruano
/**
* Verifica que un DNI de Perú sea valido
* @param {String} data DNI
* @returns {Boolean}
*/
const validate = data => {
const dni = data.replace('-', '').trim().toUpperCase()
if (!dni || dni.length < 9) return false
const multiples = [3, 2, 7, 6, 5, 4, 3, 2]
const dcontrols = {
@Rigo85
Rigo85 / postgres_queries_and_commands.sql
Created June 13, 2020 17:42 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@Rigo85
Rigo85 / docker-api-port.md
Created November 17, 2021 17:00 — forked from styblope/docker-api-port.md
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@Rigo85
Rigo85 / feriados_peru.js
Created August 16, 2022 14:15
Web Scraping a https://www.gob.pe/feriados para obtener los feriados aprobados por el gobierno de Perú.
const axios = require('axios').default;
const cheerio = require('cheerio');
(async () => {
try {
const response = await axios.get("https://www.gob.pe/feriados");
const body = await response.data;
const $ = cheerio.load(body);
const elements = $('ul > li > .holidays__list-item-date, .holidays__list-item-name').map((i, e) => e.children[0].data);
@Rigo85
Rigo85 / p7zip_lzma_ultra.md
Created November 29, 2023 23:43 — forked from mrroot5/p7zip_lzma_ultra.md
p7zip - 7zip lzma y lzma2 compresión máxima ultra. Keywords: zip, 7zip, p7zip, ubuntu, compress, comprimir

Intro

Compresión de ficheros con 7zip en Linux.

Probado en Ubuntu 14.04 > 18.04

7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on comprimido.7z -mhe -pSECRET mi_carpeta_a_comprimir
  • t7z : archivo 7z