Skip to content

Instantly share code, notes, and snippets.

View vinicioslc's full-sized avatar
💭
I could be slow at responses

Vinicios Clarindo vinicioslc

💭
I could be slow at responses
View GitHub Profile
@vinicioslc
vinicioslc / update unique values with data.js
Created June 5, 2024 18:24
Add random value to unique columns in adonisjs v4.1 to allow add again random columns
const nanoid = require('nanoid') // npm i nanoid@3
/** @type {import('@adonisjs/lucid/src/Database')} */
const Database = use('Database')
module.exports = {
removeUniqueWithData,
}
async function removeUniqueWithData(
tableName,
column,
@vinicioslc
vinicioslc / github_gpg_key.md
Created October 30, 2023 21:30 — forked from ankurk91/github_gpg_key.md
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@vinicioslc
vinicioslc / csgo.cfg
Created March 16, 2023 20:23
My custom cfg for sens and crosshair
// EXEC BUYBINDS //
exec "buybinds.cfg"
//------------------------------------------SCREEN CONFIG-------------------------//
echo "------------------------- vinny.cfg -------------------------START"
// video mode
echo "[CFG] 1280 720 0"
mat_setvideomode 1280 720 0
// 1280x960
@vinicioslc
vinicioslc / How to add server support ubuntu desktop.md
Last active November 21, 2022 23:09
Convert notebook ubuntu-desktop installation to be an ubuntu-server with screen auto power off

Some essentials commands to turn your notebook on a personal Ubuntu VPS

Enabling SSH on Ubuntu

sudo apt update
sudo apt install openssh-server && sudo systemctl status ssh

When UFW is enable on ubuntu installation you will need add ssh to firewall rules

sudo ufw allow ssh
@vinicioslc
vinicioslc / removeDuplicateStrings_nodejs_performance_readability.js
Created November 1, 2022 00:45
A good remove duplicates function in nodejs that uses good readability principles and performance concepts like hashmaps
const removeDuplicateStrings = (array) => {
const uniqueValues = [];
const seenMap = {};
for (const item of array) {
if (seenMap[item]) continue;
seenMap[item] = true;
uniqueValues.push(item);
}
@vinicioslc
vinicioslc / .bashrc
Last active July 26, 2023 21:23 — forked from ChugunovRoman/.bashrc
Alias for npm run with auto completing a npm scripts from package.json from current directory.
## NR npm alias
alias nr="npm run"
_npm_scripts() {
# check package.json file in current directory
if [ ! -f ./package.json ]; then
return
fi
@vinicioslc
vinicioslc / development_tools.sh
Last active March 22, 2022 13:30
Things to do after install debian SO (setup dev env)
sudo apt-get update # update all repositories
# git setup
sudo apt-get install git
sudo apt-get install gitk # for GUI representation of git history
sudo apt-get install xclip # xclip is for saving shell output in clipboard
git config --global color.ui true # for colourful output in terminal
git config --global user.name "The Name" # write here your name and email
git config --global user.email "[email protected]"
@vinicioslc
vinicioslc / Como funciona integração e entrega contínua.md
Last active February 6, 2021 21:41
Como funciona integração/entrega contínua

Oque é CI/CD ?

Em engenharia de software, CI/CD ou CICD pode se referir às práticas combinadas de integração contínua e entrega contínua.

A Integração Contínua, ou apenas o CI (Continuous Integration) como é conhecida, “é uma prática de desenvolvimento de software na qual você compila e testa software toda vez que um desenvolvedor envia código para a aplicação, e isso acontece várias vezes ao dia”.

@vinicioslc
vinicioslc / Fix maximum callstack size exceeds when use .npmrc.md
Created February 6, 2021 20:17
Fix maximum callstack size exceeds when use .npmrc

The simplest workaround its rename .npmrc before executes npm install and after install deps restore the original file, like the following approach:

    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
 with:
@vinicioslc
vinicioslc / how-define-cmder-as-vscode-terminal.md
Created February 6, 2021 18:54
Define Cmder as VSCODE Terminal
  1. Install Cmder with chocolatey in administrator powershell cinst cmder -y

  2. Open vscode settings.json and add or customize these lines

  "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
  "terminal.integrated.shellArgs.windows": [
    "/k C:\\tools\\Cmder\\vendor\\init.bat"
 ]