Skip to content

Instantly share code, notes, and snippets.

const xlsx = require('xlsx')
const { Writable, Transform } = require('stream')
const fs = require('fs')
const path = require('path')
console.log('início')
const workbook = xlsx.readFile('data-600.xlsx', { sheetStubs: true })
@viT-1
viT-1 / how-to-jest-esm.md
Last active April 9, 2023 20:50
#gist-bookmark #jest #test #esm #alias #js
@harrisjose
harrisjose / [token].js
Created August 20, 2021 15:13
Telegram bot using Next.js API Routes
import Cors from 'micro-cors'
import got from 'got'
import { format } from 'date-fns'
import { isEmpty, makeYaml } from 'utils'
const getContent = (message) => {
let { entities, text } = message
// Get url for the note
let urlEntity = entities.find((e) => e.type === 'url')
@passivebot
passivebot / brave_test.py
Created April 19, 2021 19:41
Selenium with Python: Tutorial on Automating Brave. Brave Browser and Webdriver Manager
# Required libraries
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from webdriver_manager.chrome import ChromeDriverManager
# Define Brave path
brave_path = "C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe"
options = webdriver.ChromeOptions()
options.binary_location = brave_path
# How to consume Github Package private registry with yarn?
Create an .npmrc file in the same location as the package.json with this content.
```
registry=https://registry.yarnpkg.com/
@<username>:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=<your auth token>
always-auth=true
@KRTirtho
KRTirtho / vs-code.settings.json
Created October 17, 2020 16:22
Excluding file watchers & search indexing in unintended folders and files in Visula
//Add following lines of code to exclude the files & folders which aren't important for watchers to look for changes...
{
//exludes fies & folders in search indexing
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/env": true,
"**/venv": true
},
//exludes fies & folders for watcher service
// __mocks__/axios.js
export default {
get: jest.fn(() => Promise.resolve({ data: {} })),
post: jest.fn(() => Promise.resolve({ data: {} })),
put: jest.fn(() => Promise.resolve({ data: {} })),
// ...
}
// how it can be implemented in our tests
@emersonbroga
emersonbroga / Readme.md
Last active October 25, 2022 13:28
Convert images from CR2 to JPG.

Conversor de imagens de CR2 para JPG

instruções

salve o código como index.js crie uma pasta chamada CR2 adicione os seus arquivos CR2 la crie uma pasta chamada JPG e deixe ela vazia abra o seu terminal e rode npm install --save cr2-raw depois rode node index.js

@rstacruz
rstacruz / README.md
Last active January 2, 2026 06:19
Setting up Jest with ESM

Setting up Jest with ESM

Here are some different ways on how to set up Jest to support ESM. This applies for Jest v25, Node v13, and Babel v7.

Method A: Native Node.js support

Node v14 and Jest v26 support ESM natively with the --experimental-vm-modules flag.

Install cross-env:

@reginadiana
reginadiana / README-TEMPLATE.md
Last active March 2, 2026 23:32
Template sugestivo para documentação de projetos

Titulo ou Arte do Projeto