Skip to content

Instantly share code, notes, and snippets.

View phellipeandrade's full-sized avatar
🏡
Working from home

Phellipe Andrade phellipeandrade

🏡
Working from home
  • São Paulo - Brazil
View GitHub Profile
const sample = [
[
[
[
[
[
{
foo: [{ rate: 2.18 }],
},
],
@carlolars
carlolars / gitkraken-wsl-bash.bat
Last active February 10, 2023 21:08
Use bash from WSL as sh.exe for GitKraken (5.0.4) for Windows
@echo off
REM Make sure that the path to the script is correct!
@bash -l -c "~/bin/gitkraken-wsl-bash.sh %*"
@emersonbroga
emersonbroga / README.md
Last active November 25, 2018 14:14
Bitcoin value with Javascript

Bitcoin Price

How to run

npm install --save request
node bitcoin-price.js
@gaibz
gaibz / db.js
Last active May 5, 2021 07:34
NeDB Encryption & Decryption (Work 2020)
/**
* NeDB With Encryption & Decryption
* Last Update 12 Feb 2020
*
* @author : Herlangga Sefani Wijaya <https://github.com/gaibz>
*/
const path = require('path') // path for database
const Datastore = require("nedb") // of course you need NeDB
const crypto = require('crypto') // now is in node default module
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active February 13, 2024 14:30
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
@cowboy
cowboy / mock-axios.js
Last active April 14, 2024 05:40
axios mocking via interceptors
import axios from 'axios'
let mockingEnabled = false
const mocks = {}
export function addMock(url, data) {
mocks[url] = data
}
@callmeloureiro
callmeloureiro / comoNaoDeixarNoVaucoNoWhatsapp.js
Last active June 5, 2021 13:29
Como não deixar no vácuo no whatsapp
/*
Hoje não deixaremos mais ninguém no vácuo no whatsapp
Para utilizar:
- Abra o web.whatsapp.com;
- Abra o console e cole o código que está no gist;
- Aguarde e verá uma mensagem sendo enviada a cada momento que alguém te enviar alguma mensagem.
Confira também como ser chato no whatsapp: https://gist.github.com/mathloureiro/4c74d60f051ed59650cc76d1da0d32da
e como ser chato no mensseger: https://gist.github.com/mathloureiro/d3f91d19cf148838217e42a0c6df5ed8
*/
@callmeloureiro
callmeloureiro / comoSerChatoNoWhatsapp.js
Last active January 15, 2024 20:44
Como fazer alguém te responder no whatsapp
/*
Hoje iremos MUDAR a vida da pessoa que não te responde no whatsappp...
Que tal enviar mensagens pra ela até obter uma resposta?!
Sensacional não acha?! Mas, somos devs, correto?! Então vamos automatizar esse paranauê!
Para utilizar:
- Abra o web.whatsapp.com;
- Selecione a conversa que você quer;
- Abra o console e cole o código que está no gist;
@Atinux
Atinux / async-foreach.js
Last active October 10, 2023 03:04
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@aelkz
aelkz / [FEDORA] gitkraken
Last active November 14, 2023 05:50
How to install gitkraken on Fedora [25,26,27] + launcher icon
#!/bin/bash
# Download GitKraken
wget https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz
# copy the downloaded file into /opt directory
cp gitkraken-amd64.tar.gz /opt/
cd /opt