Skip to content

Instantly share code, notes, and snippets.

View saiberz's full-sized avatar
🌴
Traveling

Fredy M. saiberz

🌴
Traveling
View GitHub Profile
@saiberz
saiberz / TIL.md
Last active February 18, 2021 19:38

TIL

Apr 28

  • spacemacs search in opened buffers: SPC sb
  • how to use apollo to match different type of responses from graphql

Dec 5

  • I've been far from city and computers from a week and I found this nice tutorial in haskell, I plan to follow it and implement it in Racket.
{
"basics": {
"name": "Fredy Morales",
"label": "Full Stack Developer",
"picture": "",
"email": "fredyml@icloud.com",
"phone": "+51945425950",
"website": "https://fredys.space",
"summary": "Experienced software developer with a demonstrated history of working in the information technology industry. Skilled in frontend, backend and devops tech.",
"location": {
<?php
function createConn($options){
$host = $options["host"];
$user = $options["user"];
$pass = $options["pass"];
$db = $options["db"];
$uri = 'mysql:host=' . $host . ';dbname=' . $db;
return new PDO($uri, $user, $pass);
function processData(input) {
var [other, ...numbers] = input.split("\n")
console.log({ input });
console.log({ numbers });
numbers.map(x => isValid(x));
}
function isValid(number) {
var re = /^\([\+\-]?((?:[1-9]\d{1,2})(?:\.\d+)?)\, [\+\-]?((?:[1-9]\d{1,2})(?:\.\d+)?)\)$/g;
var response = number.match(re);
@saiberz
saiberz / install-elixir.sh
Created May 27, 2019 05:51
Install elixir on ubuntu 18.04
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install esl-erlang
sudo apt-get install elixir
# get all text needed to be translated
mix gettext.extract
# update new translations and generate new po files
mix gettext.extract --merge
# Add new language
mix gettext.merge priv/gettext --locale pt_BR
@saiberz
saiberz / elixir_deploy.md
Last active October 31, 2018 19:37
Steps to deploy elixir app

Requirements

Servers

  • Install erlang
  • Install elixir
  • Install mix
  • Port 22

Local

  • Install git
  • Install erlang
@saiberz
saiberz / docker_clone_volume.sh
Created September 7, 2018 02:42
Duplicate named volume
#!/bin/bash
#Author: Guido Diepen
#Convenience script that can help me to easily create a clone of a given
#data volume. The script is mainly useful if you are using named volumes
#First check if the user provided all needed arguments
if [ "$1" = "" ]
@saiberz
saiberz / vimfiler-shortcuts
Created July 30, 2018 03:01 — forked from elithrade/vimfiler-shortcuts
Common vimfiler keyboard shortcuts
Toggle safe mode: gs
Create new file: N
Delete file: d
Rename file: r
New directory: K
Open file: e
Move file: m
Open VimFilerExplorer: e
Open current directory in a new buffer: dl
Open current directory in a new split: ds
@saiberz
saiberz / await-async-map.js
Created June 28, 2017 07:28
await-async-map
// node --harmony await-async-map.js
async function map([head, ...rest], fn, acc = []) {
if (!head) {
return acc;
}
return map(rest, fn, [...acc, await fn(head)]);
};