Skip to content

Instantly share code, notes, and snippets.

View virtualprodigy's full-sized avatar

virtualprodigy

View GitHub Profile
@virtualprodigy
virtualprodigy / Android_Compose_OG_Webview_Integration.kt
Created January 31, 2023 18:18
Adding a webview in Compose. Other views maybe substituted
AndroidView(factory = {
WebView(it).apply {
layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
webViewClient = WebViewClient()
loadUrl(url)
@virtualprodigy
virtualprodigy / Quick Start - Android Compose App Gradle Files.md
Last active January 31, 2023 18:15
Quick Start - Android Compose App Gradle Files

ReadMe

Thanks for checking out my gist. This is a handy quick-start template for your Gradle files to setup an Android Compose app with the following features

Note Versions May Have Changed

App

  • Kotlin Support
  • Material 3 (Theming)
  • Retrofit 2 (Networking)
  • Android ViewModel Support
@virtualprodigy
virtualprodigy / lambda_read_write_s3.md
Last active June 5, 2019 16:59
A simple Lambda function that will write/update/fetch a file on S3

How to Upload / Fetch a File To AWS S3

Below is a simple Lambda function that will write/update/fetch a file on S3. You'll need to provision your Lambda and S3 resources first or the execution will fail. This code was written for Node.js 8.10 Lambda in Javascript

console.log('Loading function');
const aws = require('aws-sdk');
const s3 = new aws.S3({apiVersion: '2006-03-01'});
@virtualprodigy
virtualprodigy / unlock_android_device.sh
Last active February 8, 2019 16:44
This gist is targeted at Android developers who need to unlock their device via terminal. Make sure you give your script access. Mac users run : $chmod +x <location of the script>. Windows users: The ADB shell commands below will work but if you may need to DL something to run shell scripts.
adb shell input keyevent KEYCODE_WAKEUP # activate
adb shell input touchscreen swipe 530 1420 530 1120 # swipe up
adb shell input touchscreen swipe 530 1420 530 1120 # swipe up
adb shell input text <lock-code> # input password
adb shell input keyevent 66 # press enter
@virtualprodigy
virtualprodigy / release-signing.properties
Created January 3, 2019 18:30
A simple Gist on how to auto sign your Ionic Applications. Place this file in your platform/android
storeFile=<path to your android_keystore.jks>
keyAlias=<your keystore alias name>
storePassword= <password>
keyPassword= <password>
@virtualprodigy
virtualprodigy / ionic_ios_launch_social_apps.md
Last active January 3, 2019 20:17
Ionic : Launching Facebook, Twitter, LinkedIn mobile apps using urls

Creating a simple gist for launching Facebook, Twitter, and LinkedIn using the Ionic IAB(In App Browser). This gist is inspired by the fix found here

I created a config.xml edit-config tag to handle updating your info.plist for fresh platform installs. (If you run into an issue with it, please let me know)

Type Script Code

private openTwitter(username: string) {  
     this.launchExternalApp('twitter://', 'com.twitter.android', 'twitter://user?screen_name=', 'https://twitter.com/', username);  

}

@virtualprodigy
virtualprodigy / create_code_push_mobile_apps.sh
Created November 26, 2018 16:17
A simple shell script that you can use to create two AppCenter.ms CodePush projects. One for Android and one for iOS
#A script from VirtualProdigy that creates codepush applications for Android and iOS
#remember to give the script run permissions by running $chmod u+x <path to script>
# you can also run $appcenter profile list
# use the username as the ownername
echo "Fetching login details...enter the username for the ownername"
appcenter profile list
#set owner name. See offical docs https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cordova#api-reference
echo "Enter the ownername, followed by [ENTER]:"
@virtualprodigy
virtualprodigy / a_merge_create_pull_request.sh
Last active July 25, 2017 14:55
This Gist is something I cooked up because my team mates at work was having issue with Git and Pull Request. This Bash Script will merge your current branch with development but I intentionally set it to not auto commit after the merge. (You should review your merges imo). The script will continue to create a pull request on your bitbucket accou…
#VirtualProdigy gives you a script to pull dev and then switch to your branch to create a pull request!
#see the magical documentation here https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commits
#set some variables or use code below to recieve variables as input
#BIT_USER= ENTER YOUR STUFF...
#BIT_PASS= ENTER YOUR STUFF...
#BIT_URL_USERNAME= ENTER YOUR STUFF...
#BIT_URL_REPO_SLUG= ENTER YOUR STUFF...
#GIT_DESTIN_BR_NAME= ENTER YOUR STUFF...