Skip to content

Instantly share code, notes, and snippets.

@roqbez
roqbez / import_excel.js
Created April 30, 2021 00:00
Node.js + Nest.js code to import Excel file to a database
import { HttpService, Injectable, Logger } from '@nestjs/common';
import { InjectModel } from '@nestjs/sequelize';
import { ReadStream } from 'fs';
import { Sequelize } from 'sequelize-typescript';
import * as xlsx from 'xlsx';
import { WorkBook, WorkSheet } from 'xlsx';
import { ArquivoImportacao } from './dto/arquivo-importacao.dto';
@Injectable()
export class ImportacaoProcessosService {
@surfer77
surfer77 / fpAbi.json
Last active May 13, 2024 18:12
FrenPet ABI
[
{
"type": "function",
"name": "diamondCut",
"inputs": [
{
"name": "_diamondCut",
"type": "tuple[]",
"internalType": "struct IDiamond.FacetCut[]",
"components": [
@surfer77
surfer77 / FrenPetIndexer.js
Created May 2, 2024 02:01
FrenPet api entities and schema
import { createSchema } from "@ponder/core";
export default createSchema((p) => ({
Pet: p.createTable({
id: p.int(),
name: p.string().optional(),
status: p.int(),
score: p.string(),
scoreInt: p.bigint(),
level: p.int(),
@ayebrian
ayebrian / vmware.md
Last active May 13, 2024 18:11
VMware ESXi 8 / vCenter 8 / Workstation 17 license key 2024

Free VMware license keys, they should work. It works for all cores on your host system(ESXi).

vCenter Server 8 Standard

Key Tested
4F282-0MLD2-M8869-T89G0-CF240
0F41K-0MJ4H-M88U1-0C3N0-0A214

vCenter Server 7

Key Tested
@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@maxwellmlin
maxwellmlin / LPX-Trial-Reset.sh
Created April 14, 2021 03:46
Logic Pro X Trial Reset
mv -v ~/Library/Application\ Support/.lpxuserdata ~/.Trash
@tanaikech
tanaikech / submit.md
Last active May 13, 2024 18:09
Multipart-POST Request Using Google Apps Script

Multipart-POST Request Using Google Apps Script

April 20, 2019: GAS library for this situation was published. Please check it at https://github.com/tanaikech/FetchApp.

These sample scripts are for requesting multipart post using Google Apps Script.

In most cases, the multipart request is used for uploading files. So I prepared 2 sample situations as follows. For each situation, the request parameters are different.

  1. Upload a file from Google Drive to Slack.
  2. Convert an excel file to Spreadsheet on Google Drive using Drive API v3.
@HassanShanJava
HassanShanJava / HoC-vs-RenderProps-vs-Hooks.md
Created May 13, 2024 18:06 — forked from bradwestfall/HoC-vs-RenderProps-vs-Hooks.md
An explanation of why Hooks are a nicer way to abstract re-useable state and functionality vs HoC's and Render Props

HoC (pattern) vs Render Props (pattern) vs Hooks (not pattern, a new API)

Someone was asking me about comparing the HoC and Render Props patterns (and their shortcomings) to hooks. I might leave this up as a public gist for others if it's helpful.


tldr;

Issues with HoC:

@madkoding
madkoding / pair-dual-boot-bluetooth.md
Last active May 13, 2024 18:07
Pairing bluetooth devices in dual boot with Linux Ubuntu and Windows 10/11

Pairing Bluetooth Devices in Dual Boot with Linux Ubuntu and Windows 10/11

Introduction

This guide provides updated instructions for pairing Bluetooth devices (such as keyboards or mice) in a dual-boot environment with Linux Ubuntu and Windows 10/11, incorporating community feedback and suggestions.

Instructions

1. Pair in Linux First

  • Pair your Bluetooth device in Linux. This is crucial to ensure the LinkKey remains consistent.
  • Note: Do not re-pair the device in Linux after completing the pairing in Windows.
@alairock
alairock / exceptions.py
Last active May 13, 2024 18:07
Python Async Retry Decorator.
class TooManyTriesException(BaseException):
pass