Skip to content

Instantly share code, notes, and snippets.

View vjnrv's full-sized avatar

Pedro Junior vjnrv

  • São Paulo - Brasil
View GitHub Profile
@ruario
ruario / authy-fetch-extract-snap.md
Last active June 25, 2024 07:26
How to download and install Twilio Authy on a desktop Linux system without snap support
  • Make an install directory somewhere convenient and switch to it
mkdir -p ~/.local/share/authy
cd ~/.local/share/authy
  • Fetch the current Authy snap
@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active May 12, 2024 14:24
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
@rponte
rponte / using-uuid-as-pk.md
Last active June 29, 2024 15:42
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active June 28, 2024 14:47 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@codediodeio
codediodeio / database.rules.json
Last active June 22, 2024 07:03
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@javilobo8
javilobo8 / download-file.js
Last active May 27, 2024 21:00
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);
@Oxicode
Oxicode / README.md
Created March 1, 2017 21:35 — forked from brunogaspar/README.md
Install wkhtmltopdf on Ubuntu 14.04 64-bit

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64

Step 1

Install the xvfb server by running

@JusteLeblanc
JusteLeblanc / materialize_form_theme.html.twig
Created February 27, 2017 21:09
Symfony2 form theme to integrate Materialize in your Symfony2 forms
{% extends 'form_div_layout.html.twig' %}
{% block form_row -%}
<div class="row{% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %}">
<div class="input-field col s12">
{{- form_widget(form) -}}
{{- form_label(form) -}}
{{- form_errors(form) -}}
</div>
</div>
@ahtcx
ahtcx / deep-merge.js
Last active June 9, 2024 14:56
Deep-Merge JavaScript objects with ES6
// ⚠ IMPORTANT: this is old and doesn't work for many different edge cases but I'll keep it as-is for any of you want it
// ⚠ IMPORTANT: you can find more robust versions in the comments or use a library implementation such as lodash's `merge`
// Merge a `source` object to a `target` recursively
const merge = (target, source) => {
// Iterate through `source` properties and if an `Object` set property to merge of `target` and `source` properties
for (const key of Object.keys(source)) {
if (source[key] instanceof Object) Object.assign(source[key], merge(target[key], source[key]))
}
@arenoir
arenoir / material-icons.css
Created February 10, 2016 23:28
Use base64 font to use material icons with wkhtmltopdf
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url('data:font/truetype;charset=utf-8;base64,AAEAAAAPAIAAAwBwR0RFRgQAAFMAAYsIAAAAJEdQT1PgGO+cAAGLLAAAADZHU1VC5NKpUQABi2QAAGlQT1MvMgpzImMAAAF4AAAAYGNtYXDx8DHgAAAJeAAABgJjdnQgABEBRAAAD3wAAAAEZ2FzcP//AAMAAYsAAAAACGdseWZEfewEAAAXHAABckhoZWFkBtqLZgAAAPwAAAA2aGhlYQQBAgQAAAE0AAAAJGhtdHhq5mlGAAAB2AAAB6Bsb2NhOymWhQAAD4AAAAecbWF4cAQnAOEAAAFYAAAAIG5hbWUcDzXkAAGJZAAAAXpwb3N0/4YAMgABiuAAAAAgAAEAAAABAtBPvyKIXw889QAJAgAAAAAA0t6jygAAAADS3qPNAAD//gIAAgQAAAAIAAIAAAAAAAAAAQAAAgAAAAAAAgAAAAAAAgAAAQAAAAAAAAAAAAAAAAAAAAMAAQAAA80AsAAYAAAAAAACAAAAAQABAAAAQAAuAAAAAAAEAgABkAAFAAABTAFmAAAARwFMAWYAAAD1ABkAhAAAAgAFAwAAAAAAAAAAAAESAAAABAAAAAAAAAAAAAAAAIAAMP//AgAAAAAAAgAAAAAAAAEAAAAAAAAAAAAAACAAKwIAABEAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwAVAEAAKwBAAEAAVQBAAFUANQArAEAAQABVAGsAawBAACsAKwArACsAFQArAIAAKwArAKsAKwArACsAKwBAACsAFQBAAEAAVQBVAIAAgAArAIAAKwArACsAQAArAGsAlQBAAEAA