Skip to content

Instantly share code, notes, and snippets.

Inkeliz Inkeliz

Block or report user

Report or block Inkeliz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View simple-totp.go
package main
import (
"crypto/hmac"
"crypto/sha1"
"crypto/sha256"
"crypto/sha512"
"crypto/subtle"
"encoding/binary"
"fmt"
View gist:0dd973967ec1abf6cf1543e67814ffa4
// This function need the mb_string;
// This function is based on the native str_pad from PHP (https://github.com/php/php-src/blob/master/ext/standard/string.c#L5332);
const STR_PAD_INSERT_ALL = 4;
function mb_str_pad(string $input, int $pad_length, string $pad_string, int $pad_type, string $pad_encoding = 'utf8') : string {
$result = '';
$pad_insert_all = 0;
$pad_inset_limit = 1;
View nasa-api
<?php
/**
* Created by PhpStorm.
* User: lucas
* Date: 21/08/2017
* Time: 20:21
*/
// Endpoint:
$url = 'https://api.nasa.gov/planetary/sounds';
View snippet.php
<?php
const LOCAL_ARQUIVO = 'pasta/do/arquivo/';
$nomeArquivo = 'imagem.jpg';
if(!preg_match('/^(?:[a-z0-9_-]|\.(?!\.))+$/iD', $nomeArquivo)){
echo 'Arquivo é inválido';
exit;
// Isto é feito para evitar ataques para ler aquivos internos (ex. "../etc/"...), na pior das hipóteses.
View keybase.md

Keybase proof

I hereby claim:

  • I am inkeliz on github.
  • I am inkeliz (https://keybase.io/inkeliz) on keybase.
  • I have a public key ASBxbAip1iXhWnNVhkj70dQf7-H4qamf0IVjtplZwyMx7Qo

To claim this, I am signing this object:

You can’t perform that action at this time.