Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am efrenfuentes on github.
  • I am efrenfuentes (https://keybase.io/efrenfuentes) on keybase.
  • I have a public key ASCaO5Z69pzBybyGSsWGl8U81z0J4qSyTn6x5NyNboCDfgo

To claim this, I am signing this object:

View ascii.txt
,_,
(.,.)
( )
-"-"---
,_,
(O,O)
( )
-"-"---
@efrenfuentes
efrenfuentes / my_app.ex
Created May 19, 2020 — forked from alanpeabody/my_app.ex
Websockets in Elixir with Cowboy and Plug
View my_app.ex
defmodule MyApp do
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [
dispatch: dispatch
])
@efrenfuentes
efrenfuentes / gcd_and_lcm.py
Created Mar 28, 2020 — forked from endolith/gcd_and_lcm.py
GCD and LCM functions in Python for several numbers
View gcd_and_lcm.py
# Greatest common divisor of 1 or more numbers.
from functools import reduce
def gcd(*numbers):
"""
Return the greatest common divisor of 1 or more integers
Examples
--------
View rename_phoenix_project.sh
#!/bin/bash
set -e
CURRENT_NAME="Zauberantrag"
CURRENT_OTP="zauberantrag"
NEW_NAME="Wunderantrag"
NEW_OTP="wunderantrag"
@efrenfuentes
efrenfuentes / Phoenix JWT.md
Created Dec 13, 2019 — forked from odyright/Phoenix JWT.md
Elixir + Phoenix Framework 1.3 + Guardian + JWT(Refresh, Revoke, Recover) + Comeonin
View Phoenix JWT.md

Elixir + Phoenix Framework 1.3 + Guardian + JWT(Refresh, Revoke, Recover) + Comeonin

User model bootstrap

Let's generate User model and controller.

mix ecto.create
mix phoenix.gen.json Accounts User users email:string password_hash:string
@efrenfuentes
efrenfuentes / bancos
Created Oct 11, 2019 — forked from xombra/bancos
Codigo y Bancos correspondientes de Venezuela
View bancos
Banco:
<select name="banco">
<option value=""></option>
<option value="0156">100%BANCO</option>
<option value="0196">ABN AMRO BANK</option>
<option value="0172">BANCAMIGA BANCO MICROFINANCIERO, C.A.</option>
<option value="0171">BANCO ACTIVO BANCO COMERCIAL, C.A.</option>
<option value="0166">BANCO AGRICOLA</option>
<option value="0175">BANCO BICENTENARIO</option>
<option value="0128">BANCO CARONI, C.A. BANCO UNIVERSAL</option>
View how-to-squash-commits-in-git.md

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@efrenfuentes
efrenfuentes / main.go
Created Jun 5, 2018 — forked from walm/main.go
Simple Golang DNS Server
View main.go
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@efrenfuentes
efrenfuentes / md5-example.go
Created May 12, 2018 — forked from sergiotapia/md5-example.go
Golang - How to hash a string using MD5.
View md5-example.go
import (
"crypto/md5"
"encoding/hex"
)
func GetMD5Hash(text string) string {
hasher := md5.New()
hasher.Write([]byte(text))
return hex.EncodeToString(hasher.Sum(nil))
}