Skip to content

Instantly share code, notes, and snippets.

View allanzi's full-sized avatar
🤑
I may be slow to respond.

Allan Santos allanzi

🤑
I may be slow to respond.
  • São Paulo - SP
View GitHub Profile
@alexalouit
alexalouit / ModelUuid.php
Created November 13, 2019 06:36
Laravel/Lumen use uuid as id
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class ModelUuid extends Model
{
@Beneboe
Beneboe / how-to-setup-verified-commits.md
Last active March 15, 2025 14:36
How to Setup Verified Commits on Github
@MateusAndrade
MateusAndrade / states.js
Last active April 26, 2019 13:51
Brazillian States and Distrito Federal array of objects with key, name and value
const states = [
{
value: 'ac',
label: 'Acre',
key: 'ac',
}, {
value: 'al',
label: 'Alagoas',
key: 'al',
}, {
@michelmany
michelmany / app.js
Last active April 22, 2023 00:42
Vue.js 2 Vee-validate (pt-br) CPF Validation
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import VeeValidator, { Validator } from 'vee-validate'
import CpfValidator from './components/validators/cpf.validator'
import Dictionary from './components/validators/dictionary'
import Produto from './components/produtos.vue'
Validator.extend('cpf', CpfValidator)
@javilobo8
javilobo8 / download-file.js
Last active March 17, 2025 14:25
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@marcogbarcellos
marcogbarcellos / BinarySearchTree.js
Last active February 14, 2021 19:55
Creating, manipulating and calculating distance between nodes inside a Binary Search Tree
function Node(value){
this.value = value;
this.left = null;
this.right = null;
}
function BinarySearchTree() {
this.root = null;
}
BinarySearchTree.prototype.push = function (val) {
@benstr
benstr / readme.md
Created January 31, 2014 22:11
Gist Markdown Cheatsheet

#Heading 1 ##Heading 2 ###Heading 3 ####Heading 4 #####Heading 5 ######Heading 6


Paragraph

@jtdp
jtdp / gist:5443498
Last active March 5, 2025 15:32
Revert file permission changes in local git repository.. Very useful when you change permissions due to working on a samba share. Lifted from: http://stackoverflow.com/questions/2517339/git-how-to-recover-the-file-permissions-git-thinks-the-file-should-be
git diff -p \
| grep -E '^(diff|old mode|new mode)' \
| sed -e 's/^old/NEW/;s/^new/old/;s/^NEW/new/' \
| git apply