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 / 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 / color.txt
Last active November 2, 2022 20:42
Colorize Terminal
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[1;32m\]❎ DATE:\[\033[1;37m\] \d \[\033[1;32m\] ❎ USER:\[\033[1;37m\] \u \[\033[32m\] ❎ DIRECTORY:\[\033[1;37m\] \w \[\033[1;32m\] ❎ BRANCH:\[\033[1;37m\]\$(parse_git_branch)\[\033[00m\] \n\[\033[1;32m\]└ ▶ \[\033[37m\]"
GIT COLOR
#[alias]
# lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
@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 / gulpfile.js
Created July 15, 2017 00:23
Gulp Sass Automation
var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('bower');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var sh = require('shelljs');
var paths = {
@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
@michaeljymsgutierrez
michaeljymsgutierrez / image-picker.js
Created July 26, 2017 14:39
Simple work around for picking image and converting to b64
/* Initialize options */
var options = {
quality: 50,
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
allowEdit: true,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 800,
targetHeight: 800,
popoverOptions: CameraPopoverOptions,
<video id="video" width="640" height="480" autoplay></video>
<button id="snap">Snap Photo</button>
<canvas id="canvas" width="640" height="480"></canvas>
<script>
/* { audio: true } */
/* Get camera access */
if(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({ video: true }).then(function(stream) {
@michaeljymsgutierrez
michaeljymsgutierrez / Fastboot_cmd.txt
Created October 5, 2017 01:14
Fastboot command lines for android
1. Flashing the recovery image:
fastboot flash recovery recovery.img
2. Flash the kernel and bootloader:
fastboot flash boot boot.img
3. Erase a partition:
fastboot erase cache
@michaeljymsgutierrez
michaeljymsgutierrez / Breakpoints.css
Last active March 13, 2018 01:24
Bootstrap 3 Break Points
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}