Skip to content

Instantly share code, notes, and snippets.

View xerardoo's full-sized avatar
🎯
Focusing

Lucio G Pazos xerardoo

🎯
Focusing
View GitHub Profile
@xerardoo
xerardoo / cmd.txt
Created August 12, 2022 20:16
AWS CLI DotNet Login Mac
# Login every 12 hours
aws codeartifact login --tool dotnet --repository <repo_name> --domain <domain_name> --domain-owner <account_number>
@xerardoo
xerardoo / dotnet.txt
Last active August 10, 2022 03:17
DotNet Commands
DotNet
----------------------------------------------------
dotnet new sln -o project_name
dotnet new webapi -o api_name
dotnet new classlib -o lib_name
dotnet add project_name reference lib_name
@xerardoo
xerardoo / main.go
Last active June 9, 2022 11:00
How manage money in go
// https://golangprojectstructure.com/representing-money-and-currency-go-code/
// Manage in cents (integer)
package main
import "fmt"
func main() {
var sum float32
for i := 0; i < 1000000; i++ {
@xerardoo
xerardoo / Dockerfile
Created February 4, 2022 08:46
Dockerfile for Golang API Project
# Credits: https://nizu.tech/go-blog-1
FROM golang:alpine
RUN mkdir /app
WORKDIR /app
ADD go.mod .
ADD go.sum .
@xerardoo
xerardoo / free-dns.txt
Last active July 12, 2021 08:07
Free Open Public DNS Server - Quad9 (Malware Blocking Enabled):
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
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 June 5, 2020 16:43
scoll top vue component
<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 April 8, 2020 21:43 — 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
<?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 March 14, 2020 18:26 — forked from melcma/LumenNginxUbuntu
Lumen + Nginx + Ubuntu
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 March 13, 2020 09:39
Axios Vue2 Interceptor Setup for Authorization Header and Redirect
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