Skip to content

Instantly share code, notes, and snippets.

View shouse's full-sized avatar

Steven shouse

  • SIVCI
  • Kansas City, MO
View GitHub Profile
@Linch1
Linch1 / tokenPriceApi.js
Last active July 26, 2024 02:01
Retrive the price of any bsc token from it's address without using external service like poocoin/dextools
let pancakeSwapAbi = [
{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},
];
let tokenAbi = [
{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},
];
const Web3 = require('web3');
/*
Required Node.js
@mrk-han
mrk-han / emulator-install-using-avdmanager.md
Last active July 11, 2024 01:51
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

@tolpp
tolpp / android-send-push-locally-using-adb.adoc
Last active April 4, 2024 16:33
This gist explains how to send push notification locally using ADB without need network connection.

Requirements:

  • Device should be a rooted (simulator’s are rooted by default)

  • adbd should be started as root. (Rub command: adb root )

Now, send local push message using command:

@amcvitty
amcvitty / password_autofill_expo_how_to.md
Last active July 11, 2024 15:26
Configure Password Autofill on a React Native Expo app

Password Autofill on a React Native Expo app

Developing an app to accompany our website, worried that we would lose people in the transition if they couldn't remember their password, we were looking to make our app do Password AutoFill, a feature in iOS.

A talk from WWDC introducing the feature: https://developer.apple.com/videos/play/wwdc2017/206/

It works well, but there were a few bumps in the road making it work for React Native on Expo, so here are some notes to help out.

Apple's docs are here: https://developer.apple.com/documentation/security/password_autofill and they say something like this:

@ddacunha
ddacunha / OutlookSelectNext.scpt
Created June 20, 2018 01:25
[AppleScript] Select next message in Outlook 2016 (in Javascript)
var outlook = Application('Microsoft Outlook')
var selectedMessageList = outlook.currentMessages()
for ( m of selectedMessageList) {
console.log( "selectedMessageList: " + m.id())
}
var lastSelectedMessage = selectedMessageList[selectedMessageList.length-1] //set lastMessage to last item of msgList
console.log (lastSelectedMessage.subject())
# Touch, make executable and start editing a new script
# $ newscript my_new_script.sh
# edit default shebangs within the function
# include additional skeleton files as [extension].txt
# in the $defaults_txt folder defined in config
newscript() {
# Config
# where your scripts are stored
local scriptdir=~/scripts/
# if no extension is provided, default to
@DerekSelander
DerekSelander / dsresign
Last active April 16, 2023 02:26
Resign iOS .app directories, expects app dir, provisioning profile, [optional] new name for iOS app
#!/bin/bash
# MIT License
#
# Copyright (c) 2018 Derek Selander (@LOLgrep)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@ian-mcdowell
ian-mcdowell / DebuggingOverlay.m
Last active February 27, 2021 19:04
UIDebuggingInformationOverlay for iOS 10, 11, and 12
#import <objc/runtime.h>
@interface DebuggingOverlay: NSObject
@end
@implementation DebuggingOverlay
+ (void)toggleOverlay {
id debugInfoClass = NSClassFromString(@"UIDebuggingInformationOverlay");
@neverunlucky
neverunlucky / idsl-filter.sh
Last active February 4, 2021 16:42
idevicesyslog target filter shell script
#!/bin/bash
#name: idevicesyslog target filter shell script
#author: SerKo <https://github.com/serkoape>
#usage: idevicesyslog | ./idsl-filter.sh "<target name>"
#idevicesyslog | ./idsl-filter.sh "SpringBoard"
#idevicesyslog | ./idsl-filter.sh "SpringBoard(Custom.dylib)"
#idevicesyslog | sudo sh ./idsl-filter.sh "SpringBoard(Custom.dylib)"