Skip to content

Instantly share code, notes, and snippets.

View arshad115's full-sized avatar
🏋️‍♂️
Working on my Android app and a PWA in Vue.js

Arshad Mehmood arshad115

🏋️‍♂️
Working on my Android app and a PWA in Vue.js
View GitHub Profile
@arshad115
arshad115 / Useful SQL Queries.md
Created August 2, 2018 15:19
Useful SQL Queries

Collection of Useful SQL queries

/* Count Number Of Tables In A Database */
SELECT COUNT(*) AS TABLE_COUNT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'
 
/* Count Number Of Views In A Database */
SELECT COUNT(*) AS VIEW_COUNT FROM INFORMATION_SCHEMA.VIEWS
 
/* Count Number Of Stored Procedures In A Database */
@arshad115
arshad115 / bind data model with angular ui datepicker.md
Last active August 1, 2018 11:43
How to bind data correctly with ng-model with angular uib-datepicker-popup

How to bind data correctly with ng-model with angular uib-datepicker-popup

If you get a date from a database and you bind it to the Angular ui datepicker and it does not bind correctly, you just have to convert it into a date object on init like:

JS

data.bsc = new Date(data.bsc);

HTML

@arshad115
arshad115 / gist:158c7d079337e0120727
Created June 10, 2015 09:50
Android L - fixing Service Intent must be explicit, with multiple results/packages
/***
* Android L (lollipop, API 21) introduced a new problem when trying to invoke implicit intent,
* "java.lang.IllegalArgumentException: Service Intent must be explicit"
*
* The function given here works for a single application package with the same intent filter.
* https://gist.github.com/SeanZoR/068f19545e51e4627749
*
* I had a scenario in which there was a free version and a paid version of the same app installed, this function returns null in that case.
* So I decided to fix it and here is the working solution which matches the application package and then returns the correct intent.
*