Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sdesalas's full-sized avatar
🕹️

Steven de Salas sdesalas

🕹️
View GitHub Profile
@mandrean
mandrean / install-nodejs-lts-raspberry-pi-zero-w-armv6
Created November 7, 2022 11:22
Install NodeJS LTS on Raspberry Pi Zero W (ARMv6)
# update system
$ sudo apt update && sudo apt upgrade
# uninstall old node (v10?)
$ sudo apt remove nodejs npm -y
# install nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
# use 'unofficial builds' in nvm
@sdesalas
sdesalas / various.sh
Created May 22, 2022 17:35
Db backup scripts
for DB in $(mysql -u root -p<password> -h <IP of DB> -e 'show databases' -s --skip-column-names); do
mysqldump -u root -p<password> -h<IP of DB> $DB > "$DB.sql";
@PraneshASP
PraneshASP / createWallet.js
Last active March 12, 2024 11:51
Create a bitcoin wallet with this simple script.
//Import dependencies
const bip32 = require('bip32')
const bip39 = require('bip39')
const bitcoin = require('bitcoinjs-lib')
//Define the network
const network = bitcoin.networks.bitcoin //use networks.testnet for testnet
// Derivation path
const path = `m/49'/0'/0'/0` // Use m/49'/1'/0'/0 for testnet
@sindresorhus
sindresorhus / esm-package.md
Last active April 23, 2024 05:25
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@alexroan
alexroan / Chainlink-PriceConsumer.sol
Last active March 23, 2022 22:18
Chainlink-PriceConsumer.sol
@andelf
andelf / trc20.js
Created April 20, 2020 07:12
Get TRC20 balance and transfer USDT tokens
const TronWeb = require('tronweb');
const HttpProvider = TronWeb.providers.HttpProvider;
const fullNode = new HttpProvider("https://api.trongrid.io");
// const fullNode = new HttpProvider("http://192.168.1.162:8090");
const solidityNode = new HttpProvider("https://api.trongrid.io");
const eventServer = new HttpProvider("https://api.trongrid.io");
const privateKey = "3481E79956D4BD95F358AC96D151C976392FC4E3FC132F78A847906DE588C145";
const tronWeb = new TronWeb(fullNode, solidityNode, eventServer, privateKey);
/*
* RPC: https://rpc.tomochain.com mainnet, https://rpc.testnet.tomochain.com testnet
* chainId: 88 mainnet, 89 testnet
*/
const Web3 = require('web3')
const rpc = 'https://rpc.testnet.tomochain.com'
const chainId = 89
const pkey = 'YOUR_PKEY' // token holder pkey
@AlenaNik
AlenaNik / WebGL-frameworks-libraries.md
Created May 28, 2019 18:33 — forked from dmnsgn/WebGL-WebGPU-frameworks-libraries.md
A collection of WebGL frameworks and libraries

A non-exhaustive list of WebGL frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are outdated/not maintained anymore.

Engines and libraries

  • three.js: JavaScript 3D library
  • stack.gl: an open software ecosystem for WebGL, built on top of browserify and npm.
  • PixiJS: Super fast HTML 5 2D rendering engine that uses webGL with canvas fallback
  • Pex: Pex is a javascript 3d library / engine allowing for seamless development between Plask and WebGL in the browser.
  • Babylon.js: a complete JavaScript framework for building 3D games with HTML 5 and WebGL
  • Filament: Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS and WASM/WebGL
  • ClayGL: A WebGL graphic library helping you to
@edwinlee
edwinlee / Code.gs
Last active February 21, 2024 10:43
Sync a Google Sheets spreadsheet to a Firebase Realtime database
/**
* Copyright 2019 Google LLC.
* SPDX-License-Identifier: Apache-2.0
*/
function getEnvironment() {
var environment = {
spreadsheetID: "<REPLACE WITH YOUR SPREADSHEET ID>",
firebaseUrl: "<REPLACE WITH YOUR REALTIME DB URL>"
};
@drumadrian
drumadrian / install_logstash_on_amazon_linux.bash
Last active March 15, 2024 17:22
Sample logstash.conf file for S3 Input plugin
# References:
# https://www.elastic.co/guide/en/logstash/current/plugins-inputs-s3.html
# https://www.elastic.co/blog/logstash-lines-inproved-resilience-in-S3-input
# https://www.elastic.co/guide/en/logstash/6.3/installing-logstash.html
# https://www.elastic.co/guide/en/logstash/current/working-with-plugins.html
# https://www.garron.me/en/bits/curl-delete-request.html
sudo yum update -y
sudo yum install -y java-1.8.0-openjdk
java -version