Skip to content

Instantly share code, notes, and snippets.

View matiaslopezd's full-sized avatar
🛰️
matiaslopezd[at]404.city

Matías López matiaslopezd

🛰️
matiaslopezd[at]404.city
View GitHub Profile
@matiaslopezd
matiaslopezd / script.js
Last active December 1, 2020 21:03
ATM script buttons footer
const nodes = [439, 5422, 5424, 5426];
function addClass(node, number) {
node.classList.remove('popmake-439');
node.classList.add(`popmake-${number}`);
}
document.querySelectorAll('.popmake-439').forEach((node, index) => (nodes[index]) && addClass(node, nodes[index]));
@matiaslopezd
matiaslopezd / dmesg
Last active January 29, 2020 15:47
Log my Disk
[ 0.000000] microcode: microcode updated early to revision 0x2b, date = 2018-03-22
[ 0.000000] Linux version 5.0.0-31-generic (buildd@lcy01-amd64-010) (gcc version 8.3.0 (Ubuntu 8.3.0-6ubuntu1)) #33-Ubuntu SMP Mon Sep 30 18:51:59 UTC 2019 (Ubuntu 5.0.0-31.33-generic 5.0.21)
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.0.0-31-generic root=UUID=18ba9e95-b6ba-48c2-8b2d-e5ad650aaefa ro quiet splash
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Hygon HygonGenuine
[ 0.000000] Centaur CentaurHauls
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
@matiaslopezd
matiaslopezd / NoVNC_Paste.js
Created February 3, 2020 15:22 — forked from byjg/NoVNC_Paste.js
How to Paste code to NoVNC.
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
window.sendString = function (str) {
f(str.split(""));
function f(t) {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = character.match(/[A-Z!@#$%^&*()_+{}:\"<>?~|]/);
@matiaslopezd
matiaslopezd / gist:5e6b8ee4f4e2de11a45baf91003873c5
Created February 3, 2020 20:25
Activate gnrok in port 8080 for VueJS
ngrok http https://localhost:8080 -bind-tls=true -host-header="localhost:8080"
@matiaslopezd
matiaslopezd / README.md
Last active February 14, 2020 05:05
How to use $regex of MongoDB with FeathersJS

How to use

First before to use $regex in query params, need understand the nomenclature of nested query params format in feathersJS.

The [String|Number] represent a object value when the value inside of array is String. Meanwhile that value inside of array is a Number represent an array.

For example, for set a object like a value of name key need write like this: name[key]=value, this is equal to:

{
@matiaslopezd
matiaslopezd / notice-script.js
Last active February 18, 2020 17:14
Script for add notice of giftcard beneficiary
function AddNotice() {
const main = document.querySelector('#empty_space_rest_buyer');
// Create elements
const element = document.createElement('div');
const title = document.createElement('h2');
const notice = document.createElement('p');
// Add class
element.classList.add('beneficiary-container-notice');
title.classList.add('beneficiary-title-notice');
notice.classList.add('beneficiary-subtitle-notice');
@matiaslopezd
matiaslopezd / webhook.header.txt
Last active September 5, 2025 07:09
Woocommerce webhook payload and header example
expect 100-continue
content-length 1998
connection close
x-wc-webhook-delivery-id 36e520ebabc2fa725092ff4a47acedf2
x-wc-webhook-id 3
x-wc-webhook-signature 5poyFy4qB6fdvvT5pGbefZmfkpL48uD47F0WYwfmpo4=
x-wc-webhook-event created
x-wc-webhook-resource order
x-wc-webhook-topic order.created
x-wc-webhook-source https://www.website.com/
@matiaslopezd
matiaslopezd / README.md
Created March 16, 2020 14:34
How to add authentication to MongoDB
@matiaslopezd
matiaslopezd / get-headers.js
Last active March 26, 2020 15:21
Simple object for get headers and properties of website with ajax
const myHeaders = {
get: function getHeader(url = window.location, obj = {}) {
return new Promise((resolve) => {
function checkWhichSplit(string = '') {
if (string.includes(',')) return ',';
else if (string.includes(';')) return ';';
else return undefined;
}
function parseHeader(string = '') {
@matiaslopezd
matiaslopezd / node-gyp.md
Last active April 1, 2020 14:45
Solve to problem of permissions access to node-gyp

To solve the problem when execute npm install and get node-gyp error access permission:

EACCES current user ("$user") does not have permission to access the dev dir "/root/.cache/node-gyp/12.16.1"

Execute the follow commands:

sudo npm -g install node-gyp --unsafe-perm