Skip to content

Instantly share code, notes, and snippets.

View renesansz's full-sized avatar
🎯
Focusing

Renemari Padillo renesansz

🎯
Focusing
View GitHub Profile
@renesansz
renesansz / httpInterceptor.js
Created February 16, 2016 11:06
$http interceptor
/**
* App Factory: httpInterceptor
* -------------------------
* The $http interceptor.
* This is where you can modify the $http message before/after the request is sent to the server.
*
* Here's a very useful article regarding $http interceptors:
* https://thinkster.io/interceptors
*
* USEFUL TIP:
@renesansz
renesansz / init.sh
Created January 14, 2016 23:09
Bootstrap script for freshly installed Mac
#!/bin/bash
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install necessary commands
brew update
brew upgrade
# Install useful apps using Homebrew
@renesansz
renesansz / hexcodes.md
Last active January 7, 2016 04:03
Some missing useful terminal shortcuts (Mac OSX)

Open up iTerm and go to iTerm -> preferences -> keys, then add the following hex codes:

Deleting a word

0x17 (⌥ + Delete)

Deleting a line

0x15 (⌘ + Delete)

Move cursor to word on the right

0x05 (⌘ + →)

Move cursor to word on the left

0x01 (⌘ + ⃪)

@renesansz
renesansz / learning_resources.md
Created November 29, 2015 06:57 — forked from nathansmith/web-design-development-learning-resources.md
Resources for learning web design & front-end development
@renesansz
renesansz / gmaps-directions.js
Created November 17, 2015 01:46
Angular Gmaps Directions service.
/**
* Initialize Directions Service
*
* @param {Object} origin - The latitude & longitude of origin point
*/
function _InitializeGmapsDirections(origin) {
// Set map zoom base on markers
var _SetMapZoom = function (positionList) {
@renesansz
renesansz / template-cache.js
Created November 2, 2015 18:49
Template Cache service
(function () {
'use strict';
angular.module('app.factories').factory('TemplateCache', TemplateCache);
function TemplateCache($http, $templateCache) {
return {
Register: _Register
/**
* ================== angular-ios9-uiwebview.patch.js v1.1.1 ==================
*
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
*
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular
* have the workaround baked in.
*
* To apply this patch load/bundle this file with your application and add a
@renesansz
renesansz / lcm.java
Created September 13, 2015 06:38
Get LCM of two numbers in Java
/**
* Get the Greatest Common Denominator of two numbers.
*
* @param {int} num1
* @param {int} num2
*
* @return {int}
* */
private static int getGCD(int num1, int num2) {
@renesansz
renesansz / fallback-src.js
Created August 4, 2015 06:10
Image Fallback Source for Angular JS
/**
* App Directive: fallback-src
* -----------------------------
* This directive is being used along with <img> to set the src to default if incase the remote image isn't found.
*
* Usage: <img fallback-src="your-path-here" ng-src="to-remote-path" />
*/
(function () {
'use strict';
@renesansz
renesansz / app.routes.js
Last active August 29, 2015 14:26
Sample Code
.state('app.search', {
cache: false,
url: 'search?postal_code',
views: {
navContent: {
templateUrl: NG_PATH.MODULES + 'search/view.html',
controller: 'SearchController as vm'
}
}
})