Skip to content

Instantly share code, notes, and snippets.

View xerardoo's full-sized avatar
🎯
Focusing

Lucio G Pazos xerardoo

🎯
Focusing
View GitHub Profile
@VincentH-Net
VincentH-Net / GenerateOpenApiOnBuildFromNet8MinimalApi.md
Last active March 30, 2024 17:49
Generate OpenApi.json on build from ASP.NET 8 Minimal API

To generate OpenApi.json on build from an ASP.NET 8 Minimal API, follow these steps:

  1. In Visual Studio for Windows 17.7.0 or later, create a new ASP.NET Core API project

  2. Follow these instructions to install Swashbuckle.AspNetCore.Cli as a local dotnet tool in your project

  3. Add these NuGet packages (or later versions) to the project:

  <ItemGroup>
  	<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0-preview.4.23260.4" />
@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++ {
@Ompluscator
Ompluscator / assert.go
Last active June 7, 2022 09:17
mocking
import (
//
// some imports
//
"github.com/stretchr/testify/assert"
)
func TestUser_HasAccess(t *testing.T) {
assert.False(t, User{}.HasAccess("admin"))
@anselal
anselal / vuejs_nprogress_cdn.html
Last active April 7, 2021 12:23
Add a progress bar (nprogress) in a Vue.js application. Progress bar will load with router links and axios requests
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.11/vue.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue-router/3.1.3/vue-router.min.js"></script>
@Hakky54
Hakky54 / openssl_commands.md
Last active April 22, 2024 16:57 — forked from p3t3r67x0/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
/**
Ionic Vue 0.0.8-next prerelease adds support for v-model to all Ionic inputs.
To try it out, run
npm install @ionic/vue@next
*/
<template>
<div class="ion-page">
<ion-header>
@analyticsindiamagazine
analyticsindiamagazine / Soln_Predict_Flight_Ticket.ipynb
Created March 7, 2019 10:17
Complete solution to MachineHack's Flight Ticket Price Prediction Hackathon
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
"github.com/jinzhu/gorm"
@xerardoo
xerardoo / listusers.bash
Created January 11, 2018 17:54
List All Users on linux
#!/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)
@AlexanderMoskovkin
AlexanderMoskovkin / shadow-dom-test.js
Created January 10, 2018 09:53
TestCafe with ShadowDOM example
import { Selector } from 'testcafe';
fixture `Shadow DOM Example`
.page `https://jsfiddle.net/txyamhcj/`;
test('Type inside shadowDOM', async t => {
const outputIframe = Selector('iframe').withAttribute('name', 'result');
const shadowInput = Selector(() => document.querySelector('#host').shadowRoot.querySelector('#txtTest'));
await t