Skip to content

Instantly share code, notes, and snippets.

Avatar
🏡
Working from home

Phellipe Andrade phellipeandrade

🏡
Working from home
  • São Paulo - Brazil
View GitHub Profile
View search.js
const sample = [
[
[
[
[
[
{
foo: [{ rate: 2.18 }],
},
],
@carlolars
carlolars / gitkraken-wsl-bash.bat
Last active Mar 26, 2022
Use bash from WSL as sh.exe for GitKraken (5.0.4) for Windows
View gitkraken-wsl-bash.bat
@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 Nov 25, 2018
Bitcoin value with Javascript
View README.md

Bitcoin Price

How to run

npm install --save request
node bitcoin-price.js
@gaibz
gaibz / db.js
Last active May 5, 2021
NeDB Encryption & Decryption (Work 2020)
View db.js
/**
* 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 Apr 10, 2022
A Gentle Introduction to Prepack, Part 1
View prepack-gentle-intro-1.md

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 May 17, 2022
axios mocking via interceptors
View mock-axios.js
import axios from 'axios'
let mockingEnabled = false
const mocks = {}
export function addMock(url, data) {
mocks[url] = data
}
@callmeloureiro
callmeloureiro / comoNaoDeixarNoVaucoNoWhatsapp.js
Last active Jun 5, 2021
Como não deixar no vácuo no whatsapp
View comoNaoDeixarNoVaucoNoWhatsapp.js
/*
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 Apr 10, 2022
Como fazer alguém te responder no whatsapp
View comoSerChatoNoWhatsapp.js
/*
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 May 18, 2022
JavaScript: async/await with forEach()
View async-foreach.js
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 Apr 1, 2022
How to install gitkraken on Fedora [25,26,27] + launcher icon
View [FEDORA] gitkraken
#!/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