Skip to content

Instantly share code, notes, and snippets.

View jairoFernandez's full-sized avatar
🙃
creating....

Jairo Fernández jairoFernandez

🙃
creating....
View GitHub Profile
import 'dart:math';
var rng = new Random();
void main(List<String> args) {
final quantity = 1000;
final stopwatch = Stopwatch()..start();
final products = createProducts(quantity);
final users = createUsers(quantity);
final usersIndexed = indexerListUser(users);
@jairoFernandez
jairoFernandez / reducer.js
Created December 19, 2020 21:11
Reducer examples
console.clear()
// const reducer = (acumulador, valorActual) => nuevoAcumulador
// valor inicial
// const reducido = [1, 2, 3].reduce((acc, el) => acc + el, 0)
// console.log(reducido) // 6
const numeros = [1, 2, 3, 4, 5]
const resultado = numeros.reduce((acc, el) => acc + el, 0)
// console.log(resultado)
@jairoFernandez
jairoFernandez / us_state_capitals.json
Created December 30, 2021 19:47 — forked from jpriebe/us_state_capitals.json
US State Capitals JSON file
{
"AL": {
"name": "Alabama",
"capital": "Montgomery",
"lat": "32.361538",
"long": "-86.279118"
},
"AK": {
"name": "Alaska",
"capital": "Juneau",
@jairoFernandez
jairoFernandez / go-table-driven-tests-parallel.md
Created March 21, 2023 15:47 — forked from posener/go-table-driven-tests-parallel.md
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
### Keybase proof
I hereby claim:
* I am jairofernandez on github.
* I am jairokubeshop (https://keybase.io/jairokubeshop) on keybase.
* I have a public key ASDaqSsHgv6cTBB8Ll3IR-MYWUkC0jo2_Q1hTOSUctX5vwo
To claim this, I am signing this object:
@jairoFernandez
jairoFernandez / keybase-gpg.sh
Created October 14, 2023 21:27 — forked from gtrabanco/keybase-gpg.sh
Import existing GPG keys from Keybase wizard and configure it for GIT
#!/usr/bin/env bash
#shellcheck disable=SC2016
set -euo pipefail
if [[ -z "${DOTLY_PATH:-}" ]] || ! output::empty_line > /dev/null 2>&1; then
red='\033[0;31m'
green='\033[0;32m'
bold_blue='\033[1m\033[34m'
normal='\033[0m'
@jairoFernandez
jairoFernandez / HisgcuKonU2al.md
Created October 14, 2023 21:40 — forked from kgnfth/HisgcuKonU2al.md
How i sign git commits using Keybase on Ubuntu 20.04 and later.

Before following the guide, you should be familiar with GPG and Keybase... oh and Linux ofcourse!

The dollar sign($) means the terminal input.

Requirements

- gpg # which is preinstalled in linux
- git
- zsh
- oh-my-zsh