Skip to content

Instantly share code, notes, and snippets.

View gau4sar's full-sized avatar
🎯
Focusing

GST gau4sar

🎯
Focusing
  • India
View GitHub Profile
/**
* Navigates only if this is safely possible; when this Fragment is still the current destination.
*/
fun Fragment.navigateSafe(
@IdRes resId: Int,
args: Bundle? = null,
navOptions: NavOptions? = null,
navigatorExtras: Navigator.Extras? = null
) {
if (mayNavigate()) findNavController().navigate(
@bradtraversy
bradtraversy / myscript.sh
Last active August 11, 2024 04:53
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
package loginapp.app
import loginapp.views.LoginScreen
import tornadofx.App
class LoginApp : App(LoginScreen::class)
@rajatrocks
rajatrocks / Ionic Cordova Toast
Created October 31, 2014 04:10
Angular factory to show either Cordova Toast plugin or a self-closing Ionic popup, so that you can develop with Toast on web and on device
// Requires the Toast plugin: https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin
// And Ionic Framework: http://ionicframework.com
// ngCordova is used here, but easily removed: http://ngcordova.com/
// When running in Cordova, show the native toast. Outside of Cordova, show an Ionic Popup for the same period of time.
// Uses the API for the Toast plugin - message, duration, position.
// Differences are that: Ionic Popup ignores position, and doesn't allow doing anything while it shows.
.factory('Toast', function($rootScope, $timeout, $ionicPopup, $cordovaToast) {
return {
show: function (message, duration, position) {