Skip to content

Instantly share code, notes, and snippets.

View michaeljymsgutierrez's full-sized avatar
:octocat:
I'm just a developer for fun ⌨️

Chael Gutierrez michaeljymsgutierrez

:octocat:
I'm just a developer for fun ⌨️
View GitHub Profile
@michaeljymsgutierrez
michaeljymsgutierrez / custom-directive.js
Created March 20, 2017 04:55
Update ng-model using custom-directive
.directive('noNegativeValue',function(){
//Custom Directive for checking negative value
return {
restrict: 'A',
require: '?ngModel',
link: function(scope, element , attrs, ngModel){
scope.$watch(attrs.ngModel, function(val){
if(val < 0){
ngModel.$setViewValue('0');
@michaeljymsgutierrez
michaeljymsgutierrez / GIT.md
Last active March 25, 2017 02:57
GIT Commands
  • git status
    • checked if files are modified
    • checked if there are untracked files
    • Example: git status
  • git add filename_and_extenstion
    • add files to commit to push in repo
    • include directory if necessary
    • Example:
      • after git status you see "modified: profiles/bms/modules/bms/angularjs_bms/js/controllers.js"
  • git add profiles/bms/modules/bms/angularjs_bms/js/controllers.js
db = window.openDatabase("dbname.db", "1.0", "Cordova Demo", 200000);
@michaeljymsgutierrez
michaeljymsgutierrez / Sublime Text 3 Build 3103 License Key - CRACK
Created April 26, 2017 05:15
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
/* Smartphones (portrait and landscape) ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen and (min-width : 321px) {
/* Styles */
}
@michaeljymsgutierrez
michaeljymsgutierrez / pull_db.sh
Created June 15, 2017 06:57
Simple db pull through adb shell
#!/bin/sh
# PACKAGE NAME
PACKAGE = com.companyname.appname
# DATABASE NAME
DB = db_app.db
# COPY ON ADB == cat
# If permission denied, change /sdcard to /storage/sdcard(#)
adb shell "run-as $PACKAGE cat /data/data/$PACKAGE/databases/$DB > /sdcard/$DB"
@michaeljymsgutierrez
michaeljymsgutierrez / custom-backdrop.js
Last active July 11, 2017 07:18
Adding backdrop to side menu
$rootScope.$watch(function(){
// Return ratio
return $ionicSideMenuDelegate.getOpenRatio();
},function (ratio){
// Broadcast the value
$rootScope.sidemenuopened = (ratio == 1);
});
// <div ng-class="{'opaque-content' : sidemenuopened}">
// Attach to side menu content
@michaeljymsgutierrez
michaeljymsgutierrez / snippet.js
Created July 13, 2017 02:35
TemporarySnippet
// Initialize Locations for Question A Mall - Foodcourt
// $rootScope.qa_regions = Location.region();
// $rootScope.qa_provinces = [];
// $rootScope.qa_city = [];
// $rootScope.qa_brgy = [];
// Initialize Locations for Question B Mall - Foodcourt
// $rootScope.qb_regions = Location.region();
// $rootScope.qb_provinces = [];
// $rootScope.qb_city = [];
@michaeljymsgutierrez
michaeljymsgutierrez / DEV-ENV-Installation.txt
Last active July 17, 2017 03:49
IONIC-DEV_ENV_INSTALLATION
# JAVA HOME
export JAVA_HOME=/home/vielsoft-dev-6/jdk1.8.0_91/
export PATH=$JAVA_HOME/bin:$PATH
# ANDROID HOME
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
source ~/.bashrc
@michaeljymsgutierrez
michaeljymsgutierrez / eptc.txt
Last active July 18, 2017 09:26
Electron Packager Terminal Command - Release Build
Note: Install Globally electron packager
npm install electron-packager -g
# Mac Os
electron-packager . --overwrite --platform=darwin --arch=x64 --icon=assets/icons/mac/icon.icns --prune=true --out=release-builds
# Windows Os
electron-packager . --overwrite --asar=true --platform=win32 --arch=ia32 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"Electron Tutorial App\"
# Linux