Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Coding

Miguel Mota miguelmota

:octocat:
Coding
View GitHub Profile
@miguelmota
miguelmota / uni_checker.js
Last active Sep 21, 2020
UNI token claim checker
View uni_checker.js
const fs = require('fs')
const fetch = require('node-fetch')
const BN = require('bignumber.js')
async function makeRequest (address) {
const url = `https://gentle-frost-9e74.uniswap.workers.dev/1/${address}`
const res = await fetch(url)
const json = await res.json()
return json
}
@miguelmota
miguelmota / clipboard.js
Created Sep 18, 2020
JavaScript copy to clipboard example using document.execCommand
View clipboard.js
const tmp = document.createElement('input')
tmp.value = 'hello world'
document.body.appendChild(tmp)
tmp.select()
document.execCommand('copy')
tmp.remove()
@miguelmota
miguelmota / fix.sh
Created Sep 13, 2020
Fix for "WARNING: '/usr/lib/perl5/5.30' contains data from at least 3 packages which will NOT be used by the installed perl interpreter."
View fix.sh
yay -S --asdeps $(pacman -Qqo '/usr/lib/perl5/5.30')
@miguelmota
miguelmota / instructions.sh
Last active Sep 14, 2020
Fire TV Stick 4K use USB drive as storage
View instructions.sh
# install adb shell apk using downloader
# open adb shell
# list usb drivers and their ids
$ sm list-disks
disk:8,0
# partiion all of usb to be used as internal storage
$ sm partition disk:8,0 private
@miguelmota
miguelmota / instructions.txt
Last active Sep 14, 2020
Install Termux on Fire TV Stick
View instructions.txt
- Add F-Droid repository https://f-droid.org/F-Droid.apk via Downloader app
- Install termux app
@miguelmota
miguelmota / mount.sh
Created Sep 5, 2020
Linux mount USB drive
View mount.sh
lsblk
udisksctl mount -b /dev/sdb1
@miguelmota
miguelmota / post-merge
Last active Sep 5, 2020
Git post-merge hook to auto-build packages on git pull
View post-merge
#!/bin/sh
# Auto-build packages that were modified after a git pull
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep -q "$1" && eval "$2"
}
@miguelmota
miguelmota / index.js
Last active Sep 2, 2020
NPM install multiple versions of same package example (ethers)
View index.js
import * as ethers from 'ethers' // v4
import * as ethers5 from 'ethers5' // v5
@miguelmota
miguelmota / vim_spell_check.txt
Last active Aug 31, 2020
Vim spell check notes
View vim_spell_check.txt
see tutorial `:help spell`
turn on `:setlocal spell`
turn on, specific language `:setlocal spell spelllang=en_us`
turn off `:setlocal nospell`
next word `]s`
prev word `[s`
hover over word `z=` to see suggestions
add good word `zg`
add wrong word `zw`
undo good word `zug`
@miguelmota
miguelmota / spellcheck.sh
Last active Aug 31, 2020
Arch linux spell check command
View spellcheck.sh
# install english dictionary words
sudo pacman -S aspell-en
# spellcheck file
aspell -c file.txt
You can’t perform that action at this time.