Skip to content

Instantly share code, notes, and snippets.

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

Diego Arrieta DiegoArrieta

🏠
Working from home
View GitHub Profile
@jsstoni
jsstoni / title.js
Last active October 3, 2019 21:46
web scraping basico
var request = require('request');
request({
method: 'GET',
url: 'https://www.genbeta.com'
}, function (err, res, body) {
if (err) return console.error(err);
var l = body.match('<title>(.*?)<\/title>');
console.log(l[1]);
});
@sergsoares
sergsoares / firebase-notification-with-curl.sh
Created April 23, 2018 00:21
Simple curl to send a notification to firebase with a deviceID.
curl -d '{
"to": DEVICE_ID,
"notification": {
"title" : " This is my title new ",
"body" : " This is the body of my message "
}
}' \
-i -H "Application/json" \
-H "Content-type: application/json" \
-H "Authorization: key=YOUR_AUTH_KEY \
@mariocesar
mariocesar / api.js
Created September 26, 2017 04:21
Axios single configured instance
import axios from "axios";
const singleton = Symbol();
const singletonEnforcer = Symbol();
function readCookie(name) {
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
return (match ? decodeURIComponent(match[3]) : null);
}
@vladimirtsyupko
vladimirtsyupko / gist:10964772
Created April 17, 2014 08:32
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@kapkaev
kapkaev / gist:4619127
Created January 24, 2013 09:30
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. Resque
$ redis-cli
> config set stop-writes-on-bgsave-error no
@jelcaf
jelcaf / Operaciones-Git
Last active May 15, 2024 15:31
Git Tips - Mini-trucos de Git para facilitarme la tarea
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
@rbonvall
rbonvall / rut.py
Created July 5, 2010 23:56
Dígito verificador del RUT en Python
# encoding=utf-8
# Obtener el dígito verificador del RUT en Python.
#
# La función recibe el RUT como un entero,
# y entrega el dígito verificador como un entero.
# Si el resultado es 10, el RUT es "raya k".
from itertools import cycle