Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Lucio G Pazos xerardoo

🎯
Focusing
View GitHub Profile
@xerardoo
xerardoo / free-dns.txt
Last active Jul 12, 2021
Free Open Public DNS Server - Quad9 (Malware Blocking Enabled):
View free-dns.txt
Free Open Public DNS Server
Quad9 (Malware Blocking Enabled):
IPv4:
Primary: 9.9.9.9
Secondary: 149.112.112.112
IPv6:
Primary: 2620:fe::fe
View checkout
var order OrderReq
err := c.BindJSON(&order)
if err != nil {
c.JSON(500, gin.H{"msg": err.Error()})
return
}
currentcb := m.GetCurrentCashBalance()
if currentcb.ID == 0 {
c.JSON(400, gin.H{"msg": "No cash balance opened - No existe corte de caja abierto"})
@xerardoo
xerardoo / scrollTop.vue
Created Jun 5, 2020
scoll top vue component
View scrollTop.vue
<template>
<button @click="goUp" class="btn-up" v-bind:class="{ 'd-block': show }">
<font-awesome-icon :icon="['fas', 'arrow-circle-up']"/>
</button>
</template>
<script>
// Based on: https://www.w3schools.com/howto/howto_js_scroll_to_top.asp
export default {
name: "ScrollTop",
@xerardoo
xerardoo / compat_l5.php
Created Apr 8, 2020 — forked from vluzrmos/compat_l5.php
Lumen L5 compatibility helpers. That file should be added on root path of your project... and added to your composer.json
View compat_l5.php
<?php
if(!function_exists('config_path'))
{
/**
* Return the path to config files
* @param null $path
* @return string
*/
function config_path($path=null)
@xerardoo
xerardoo / LumenNginxUbuntu
Created Mar 14, 2020 — forked from melcma/LumenNginxUbuntu
Lumen + Nginx + Ubuntu
View LumenNginxUbuntu
cd ~
sudo apt-get update
1. Install PHP and Nginx
#apt-get install software-properties-common
sudo apt-get -y install nginx php7.0 php7.0-fpm php7.0-mbstring php7.0-xml git composer
2. Config Nginx
@xerardoo
xerardoo / interceptors.js
Last active Mar 13, 2020
Axios Vue2 Interceptor Setup for Authorization Header and Redirect
View interceptors.js
Axios.interceptors.request.use(function (config) {
const session = JSON.parse(localStorage.getItem('session'));
config.headers['X-Token'] = session ? `${session.token}` : '';
return config;
});
Axios.interceptors.response.use((response) => { // intercept the global error
return response
}, function (error) {
if (error.response.status === 401) { // if the error is 401 and hasent already been retried
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Nuevo Contacto</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
@xerardoo
xerardoo / listusers.bash
Created Jan 11, 2018
List All Users on linux
View listusers.bash
#!/bin/bash
# Name: listusers.bash
# Purpose: List all normal user and system accounts in the system. Tested on RHEL / Debian Linux
# Author: Vivek Gite <www.cyberciti.biz>, under GPL v2.0+
# -----------------------------------------------------------------------------------
_l="/etc/login.defs"
_p="/etc/passwd"
## get mini UID limit ##
l=$(grep "^UID_MIN" $_l)
@xerardoo
xerardoo / functions.php
Last active Sep 18, 2015 — forked from gnikolopoulos/functions.php
Add Defer and Async Attributes to Render Blocking Javascript in WordPress
View functions.php
<?php
function defer_js_async($tag){
// scripts to defer.
$scripts_to_defer = array('script-name1.js', 'script-name2.js', 'script-name3.js');
// scripts to async.
$scripts_to_async = array('script-name1.js', 'script-name2.js', 'script-name3.js');
foreach($scripts_to_defer as $defer_script){
@xerardoo
xerardoo / httpd.conf
Last active Aug 29, 2015
comprimir gzip apache
View httpd.conf
#Fuente: http://blog.intropedro.com/es/content/activar-la-compresi%C3%B3n-gzip-en-apache-httpd
LoadModule deflate_module modules/mod_deflate.so
<IfModule mod_deflate.c>
# Activamos la compresión
SetOutputFilter DEFLATE
# Indicamos los tipos de contenido a comprimir