Skip to content

Instantly share code, notes, and snippets.

View emtudo's full-sized avatar

Leandro Henrique Reis emtudo

View GitHub Profile
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use BotMan\BotMan\Cache\LaravelCache;
use BotMan\BotMan\Storages\Drivers\FileStorage;
use BotMan\BotMan\BotManFactory;
use BotMan\Drivers\Facebook\FacebookDriver;
use BotMan\BotMan\Drivers\DriverManager;
@emtudo
emtudo / promise.all.js
Last active December 11, 2017 11:31
Promise.all
Promise.all([
promise1,
promise2,
promise3
]).then(() => {
return this.$router.push({'name': 'minha rota'})
})
@emtudo
emtudo / xorg.conf
Last active August 6, 2018 13:47
Travamento com vídeo Ubuntu 18.04: editar ou criar /etc/X11/xorg.conf
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
@emtudo
emtudo / optimus.desktop
Last active April 29, 2018 13:58
Problema de travamento com vídeo no ubuntu 18.04
[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer
/**
* Class to check up e-mail
*
* @author Konstantin Granin <[email protected]>
* @copyright Copyright (c) 2010, Konstantin Granin
*/
class VerifyEmail {
/**
#!/bin/sh
#
# ifup hook script for resolvconf
#
# This file is part of the resolvconf package.
#
# Interface of the internet
INTERFACE=`route | grep '^default' | grep -o '[^ ]*$'`
@emtudo
emtudo / switch-sound-microphone
Created March 22, 2019 19:40
Switch sound and microphone with command
#!/bin/sh
switchMicrophone () {
# get first device by param $1
# param = device's name or part of device's name
DEVICE=$(pacmd list-sources | grep -i "name:" | grep -i $1 | head -n 1 | grep -o "[^<]*$" | grep -o "[^>]*")
# set device
echo -e "Device selected: \e[32m${DEVICE}\e[39m"
pacmd set-default-source $DEVICE
# file: pre-push
#!/bin/sh
# An example hook script to verify what is about to be pushed. Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
{
"bip": "172.16.8.1/24",
"fixed-cidr": "172.16.8.0/24",
"ipv6": true,
"fixed-cidr-v6": "ipv6-range/80"
}
# Primeira versão, ainda precisa verificar se tem 11 dígitos
# Devolver true/false
# Tratar excessão de caracteres inválidos
defmodule Cpfcalc.Valid do
def calc(cpf) do
String.codepoints(cpf)
|> Enum.map(fn d -> String.to_integer(d) end)
|> IO.inspect()
|> calcD10()