Skip to content

Instantly share code, notes, and snippets.

View Arkiant's full-sized avatar
:octocat:
Developing cool things

Samuel Porras Arkiant

:octocat:
Developing cool things
View GitHub Profile
@Arkiant
Arkiant / settings.json
Created June 17, 2022 07:45
Visual code settings
{
"go.formatTool": "goimports",
"go.lintOnSave": "package",
"go.lintTool": "staticcheck",
"go.vetOnSave": "package",
"gopls": {
"ui.completion.usePlaceholders": true,
"ui.diagnostic.analyses": {
"fieldalignment": true,
"unusedwrite": true,
@Arkiant
Arkiant / specification.go
Created June 28, 2021 07:39 — forked from AlexanderGrom/specification.go
Golang Pattern Specification (sketch)
// Pattern Specification
//
// In the following example, we are retrieving invoices and sending them to a collection agency if
// 1. they are overdue,
// 2. notices have been sent, and
// 3. they are not already with the collection agency.
// This example is meant to show the end result of how the logic is 'chained' together.
//
// This usage example assumes a previously defined OverdueSpecification class
// that is satisfied when an invoice's due date is 30 days or older,
Automate Api e2e test:
https://www.freecodecamp.org/news/how-to-automate-rest-api-end-to-end-tests/
Sling, create client api for e2e tests
https://github.com/dghubble/sling
@Arkiant
Arkiant / uuid_test.go
Last active September 9, 2019 08:22
Performance test to choose a uuid library
package benchuuid
import (
"testing"
"github.com/lithammer/shortuuid"
"github.com/segmentio/ksuid"
"github.com/sony/sonyflake"
Genera un perfil pprof de la memoria de un programa go
------------------------------------------------------
go test -bench=. -memprofile memprofile.pprof
Chequeamos el perfil y lo analizamos en web
-------------------------------------------
go tool pprof -http=:8080 memprofile.pprof memprofile.pprof
@Arkiant
Arkiant / git-prompt-sh
Created January 20, 2019 20:59
Configuration file git prompt
if test -f /etc/profile.d/git-sdk.sh
then
TITLEPREFIX=SDK-${MSYSTEM#MINGW}
else
TITLEPREFIX=$MSYSTEM
fi
if test -f ~/.config/git/git-prompt.sh
then
. ~/.config/git/git-prompt.sh
@Arkiant
Arkiant / configuration.md
Last active January 20, 2019 21:03
Windows ssh configuration

Powershell ( Administrator )

Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'

This should return the following output:

Name  : OpenSSH.Client~~~~0.0.1.0
State : NotPresent
Name  : OpenSSH.Server~~~~0.0.1.0
@Arkiant
Arkiant / docker-environment-file.sh
Created March 1, 2018 19:51
How to postgresql set file environment data
#!/usr/bin/env bash
set -e
# usage: file_env VAR [DEFAULT]
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() {
local var="$1"
local fileVar="${var}_FILE"
@Arkiant
Arkiant / Dockerfile-selenium-nodejs
Created February 28, 2018 09:51 — forked from BretFisher/Dockerfile-selenium-nodejs
Dockerfile selenium with nodejs
FROM selenium/standalone-chrome
# lets install node 6.x then cleanup
# install build-essential and leave in case npm needs it
# we have to sudo because selenium defaults to seluser
WORKDIR /tmp
ADD https://deb.nodesource.com/setup_6.x nodesource_setup.sh
RUN sudo bash nodesource_setup.sh \
&& sudo apt-get install -y nodejs build-essential \
&& sudo rm -rf /var/lib/apt/lists/*
@Arkiant
Arkiant / .travis.yml
Created February 28, 2018 09:51 — forked from BretFisher/.travis.yml
Travis-CI Docker Image Build and Push to AWS ECR
sudo: required #is required to use docker service in travis
language: php #can be any language, just php for example
services:
- docker # required, but travis uses older version of docker :(
install:
- echo "install nothing!" # put your normal pre-testing installs here