Skip to content

Instantly share code, notes, and snippets.

View luizhenriquefbb's full-sized avatar

Luiz Henrique Freire Barros luizhenriquefbb

View GitHub Profile
@liabru
liabru / save-file-local.js
Created April 24, 2014 17:46
Save a text file locally with a filename, by triggering a download in JavaScript
/*
* Save a text file locally with a filename by triggering a download
*/
var text = "hello world",
blob = new Blob([text], { type: 'text/plain' }),
anchor = document.createElement('a');
anchor.download = "hello.txt";
anchor.href = (window.webkitURL || window.URL).createObjectURL(blob);
@nenodias
nenodias / ia_busca_star.py
Last active April 22, 2023 01:05
Algoritmo de Busca A* (A-Star) Python
#Matriz visual usada pra montar a matris de adjacência
matriz = [ [0, 1, 2],
[3, 4, 5],
[6, 7, 8], ]
'''
0 | 1 2
---
3 4 5
---
@moneal
moneal / firebase_pre-request_script.js
Created August 23, 2017 02:21
Postman pre-request script to create a Firebase authentication JWT header.
/**
* This script expects the global variables 'refresh_token' and 'firebase_api_key' to be set. 'firebase_api_key' can be found
* in the Firebase console under project settings then 'Web API Key'.
* 'refresh_token' as to be gathered from watching the network requests to https://securetoken.googleapis.com/v1/token from
* your Firebase app, look for the formdata values
*
* If all the data is found it makes a request to get a new token and sets a 'auth_jwt' environment variable and updates the
* global 'refresh_token'.
*
* Requests that need authentication should have a header with a key of 'Authentication' and value of '{{auth_jwt}}'