Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 13, 2024 18:15
set -e, -u, -o, -x pipefail explanation
@bmarkons
bmarkons / gist:5bf80b97ac4f5860f903c60cbbe3540d
Created October 5, 2021 19:38 — forked from jampajeen/gist:d19f36a7309d0ead0e1f9735a26d66f3
Disable/Enable Mac OSX sleep on lid closed
# disable sleep
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1
# re-enable sleep
sudo pmset -b sleep 5; sudo pmset -b disablesleep 0
@uixcrazy
uixcrazy / Happy Women's Day.markdown
Last active May 13, 2024 18:13
Happy Women's Day

Happy Women's Day

Women in particular need to keep an eye on their physical and mental health, because if we’re scurrying to and from appointments and errands, we don’t have a lot of time to take care of ourselves. We need to do a better job of putting ourselves higher on our own “to do” list. Michelle Obama

A Pen by uixcrazy.com on CodePen.

License.

@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.