Skip to content

Instantly share code, notes, and snippets.

View leomeloxp's full-sized avatar
🤓
Coding

Leo Melo leomeloxp

🤓
Coding
View GitHub Profile
@leomeloxp
leomeloxp / guard_pipe.ex
Created July 3, 2024 19:18 — forked from willgeorgetaylor/guard_pipe.ex
Elixir GuardPipe macro
defmodule Utils.GuardPipe do
@moduledoc ~S"""
When a value input into the pipe is an error tuple, the subsequent function in the pipeline will not execute, and the error tuple is immediately returned as the output.
Example:
iex> {:error, 9} ~> Kernel.+(1)
{:error, 9}
On the other hand, if the input is an `ok` tuple, its inner value is extracted and passed on to the next function in the pipeline. The final output of the pipe will be either an `ok` or an `error` tuple.
##############################################################################
## ZPLUG Set up
##
export ZPLUG_HOME=/usr/local/opt/zplug
source $ZPLUG_HOME/init.zsh
##############################################################################
## Installed packages
##
## Make sure to use double quotes to prevent shell expansion
const pg = require("pg");
const config = require("./config");
module.exports = {
gravaDados: dados => {
const agora = new Date();
/*
* Criando o Pool de Conexões
*
@leomeloxp
leomeloxp / Prettier settings on VSCode
Created September 21, 2018 08:52
ESLint + TSLint + Prettier on VSCode 🤓
{
// These are the only ones modified from default settings
"prettier.singleQuote": true,
"prettier.eslintIntegration": true,
}

import MDXLayout from '../components/MDXLayout.jsx'

export default ({children, ...props}) => ( <MDXLayout {...props} meta={{ title:'Now', description: 'Find out what leomeloxp is focusing on at the moment', keywords: [ 'nownownow', 'leomeloxp', 'current projects',

About

Interpolating between things using lerp.

function lerp (start, end, t) {
  return start * (1 - t) + end * t;
}

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@leomeloxp
leomeloxp / gist:e80a7db61a151203c66f532423558307
Created September 30, 2017 07:58 — forked from johanmeiring/gist:3002458
"git lg" alias for pretty git log
# From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
@leomeloxp
leomeloxp / Pokemon.py
Last active July 12, 2017 18:02
Jersey Coders Python scripts
import random
# https://goo.gl/6GFwgg
starters = [
{
'name': 'Bulbasaur',
'attacks': [
{
'name': 'Tackle',
'power': 10
},
HANGMANPICS = ['''
+---+
| |
|
|
|
|
=========''', '''