Skip to content

Instantly share code, notes, and snippets.

View aagamezl's full-sized avatar

Álvaro José Agámez Licha aagamezl

View GitHub Profile
#!/bin/bash
FMT_RED=$(printf '\033[31m')
FMT_GREEN=$(printf '\033[32m')
FMT_YELLOW=$(printf '\033[33m')
FMT_BLUE=$(printf '\033[34m')
FMT_BOLD=$(printf '\033[1m')
FMT_RESET=$(printf '\033[0m')
FMT_RESET='\033[0m' # Color Off

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@aagamezl
aagamezl / scoop-setup.ps1
Last active May 22, 2023 13:25
scoop-setup
# Git
scoop install main/git
# Add the extra buckets
scoop bucket add main
scoop bucket add extras
scoop bucket add versions
scoop bucket add java
# Java
@aagamezl
aagamezl / pdf.js
Created January 20, 2022 16:10 — forked from jdnichollsc/pdf.js
Generate PDF in base64 with jsPDF
services.factory('PDF', ['$q', function ($q) {
var createSubtopic = function (doc, subtopic, top, pageWidth) {
doc.autoTable([
{ title: "Title", dataKey: "title" },
{ title: "Value", dataKey: "value" }
], [
{ title: "Estándar", value: subtopic.standard },
{ title: "Tema", value: subtopic.topic },

Add an origin to the repository

$ git remote add origin git@github.com:User/UserRepo.git

Undoing the Last Commit

$ git reset --soft HEAD~1
@aagamezl
aagamezl / Coding.md
Created October 15, 2020 17:25 — forked from jdnichollsc/ABC.md
English - Job Interview - Common questions

Algorithms

  • Dijkstra (Shortest paths between nodes in a graph)
  • Rabin-Karp (a string-searching that uses hashing to find an exact match of a pattern string in a text)
  • Aho–Corasick (a string-searching that locates elements of a finite set of strings within an input text like "dictionary-matching")

Arrays

Given an array of size N in which every number is between 1 and N, determine if there are any duplicates

// Time complexity: O(n^2) - BAD
Get-LocalGroupMember -Group "docker-users"
Get-LocalGroup
Add-LocalGroupMember -Group "docker-users" -Member "COMPUTER-ID\username"
wsl --shutdown
@aagamezl
aagamezl / test.js
Created August 27, 2020 23:20 — forked from getify/test.js
fun call-stack experiment
function foo() {
baz();
}
function bar() {
baz();
}
function baz() {
console.log(`baz() was called from: ${whereWasICalledFrom()}`);
{
"meta": { "theme": "elegant" },
"basics": {
"name": "Álvaro José Agámez Licha",
"label": "Senior Fullstack Developer",
"picture": "",
"email": "alvaroagamez@outlook.com",
"phone": "+57 302-2184400",
"website": "",
"summary": "Senior Fullstack Developer with 15 years of experience in international projects. Proven ability to effectively lead personnel or be a team member in software development projects. Strong problem-solving abilities and committed to achieving goals in Frontend and Backend, using good practices and software patterns.",
{"lastUpload":"2021-01-26T17:19:30.045Z","extensionVersion":"v3.4.3"}