Skip to content

Instantly share code, notes, and snippets.

View manan19's full-sized avatar
🪐
Identity. Network. Content.

Manan manan19

🪐
Identity. Network. Content.
View GitHub Profile
@manan19
manan19 / Foreground Android Activity
Last active August 29, 2015 14:00
Bash command to know what android activity is currently in the foreground
adb shell dumpsys window windows | grep -E 'mFocusedApp' | cut -d'/' -f 1 | cut -d' ' -f 7
@manan19
manan19 / .bash_profile
Last active August 29, 2015 14:02
Toggle between Bitcoin livenet and testnet
function bnt() {
sed -if 's/^testnet=0/testnet=1/;
t end;
s/^testnet=1/testnet=0/;
:end;' ~/Library/Application\ Support/Bitcoin/bitcoin.conf
}
Verifying myself: My Bitcoin username is +manan. https://onename.io/manan
@manan19
manan19 / .bash_profile
Last active December 21, 2016 17:44
git branch in terminal
# git
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
@manan19
manan19 / .bash_profile
Created August 19, 2014 18:37
Opens the github page for the current git repo/branch in your browser
# Opens the github page for the current git repo/branch in your browser
function gh() {
giturl=$(git config --get remote.origin.url)
if [ "$giturl" == "" ]
then
echo "Not a git repository or no remote.origin.url set"
else
giturl=${giturl/git\@github\.com\:/https://github.com/}
giturl=${giturl/\.git/\/tree/}
@manan19
manan19 / .bash_profile
Last active December 21, 2016 17:52
Find and crush all pngs
# Image Resizing
alias cpng='find . -iname '*png' -exec pngcrush -ow -brute {} {}.crush \;'
alias spng="find . -name '*png' -ls | awk '{total += $7} END {print total}'"
Verifying my Blockstack ID is secured with the address 1GhWYtTRchygtbiiPSycukf7DgFiURSVKu https://explorer.blockstack.org/address/1GhWYtTRchygtbiiPSycukf7DgFiURSVKu
Code cleanup
https://github.com/peripheryapp/periphery
Asset cleanup
https://github.com/onevcat/FengNiao
require("dotenv").config();
const ethers = require("ethers");
const axios = require('axios').default;
const provider = new ethers.providers.JsonRpcProvider(`https://eth-mainnet.alchemyapi.io/v2/${process.env.NEXT_PUBLIC_ALCHEMY_API_KEY}`);
const alg = new ethers.Contract(
"0x32353A6C91143bfd6C7d363B546e62a9A2489A20",
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"inde
@manan19
manan19 / hub-web-dist.js
Created April 15, 2023 00:57
hub web's distribution
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __esm = (fn, res) => function __init() {
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;