This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
var Storage = function (type) { | |
function createCookie(name, value, days) { | |
var date, expires; | |
if (days) { | |
date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
expires = "; expires="+date.toGMTString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('starter.controllers', []) | |
.controller('DashCtrl', function ($scope) { | |
}) | |
.controller('FriendsCtrl', function ($scope, Friends) { | |
Friends.init() | |
.then(function (_data) { | |
console.log(_data.data.deployment_id); | |
Friends.all().then(function (_data) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When I developed an app for ios by phonegap, I had a trouble in changing the <input> input cursor color. | |
but now, there is a solution for it: | |
--------------- | |
<style> | |
input { | |
color: rgb(60, 0, 248); /* change [input cursor color] by this*/ | |
text-shadow: 0px 0px 0px #D60B0B; /* change [input font] by this*/ | |
-webkit-text-fill-color: transparent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# This script fetches the current open tabs in all Safari windows. | |
# Useful to run remotely on your mac when you are at work and want | |
# to read a page you have open (remotely) at home but don't remember | |
# the url but can log in to your home system on the cmmand line | |
# | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Right click an element and select "Inspect Element" | |
// Courtesy : http://michalostruszka.pl/blog/2013/09/24/angularjs-in-browsers-console/ & | |
// http://ionicframework.com/blog/angularjs-console/ | |
var scope = angular.element($0).scope(); | |
var rootScope = scope.$root | |
scope.$apply( function() { | |
rootScope.$broadcast('showOffline', {msg : 'goes here', duration : 1230}); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function countAngularWatchers(angular) { | |
var i, data, scope, | |
count = 0, | |
all = document.all, | |
len = all.length, | |
test = {}; | |
var mostWatchers = 0; | |
function countScopeWatchers(scope, element) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = document.getElementsByTagName('body'); | |
var scope = angular.element(app[0]).scope(); | |
var rootScope = scope.$root | |
// Make app think you're offline | |
scope.$apply( function() { | |
rootScope.$broadcast('$cordovaNetwork:offline'); | |
}); | |
// Make app think you're online |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NVM version shortcut | |
# change title name of tab in terminal | |
function title { | |
echo -ne "\033]0;"$*"\007" | |
} | |
cd() { | |
builtin cd "$@" || return | |
#echo $PREV_PWD | |
if [ "$PWD" != "$PREV_PWD" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Mutilator(data, name, context) { | |
this.n = name || `mutilation-${+new Date()}`; | |
this.d = data; | |
this.c = context || window; | |
this.isArr = function(p) { | |
return this.d[p].constructor == Array; | |
}; | |
this.dispatch = function(p, v, t) { | |
this.c.dispatchEvent( | |
new CustomEvent(this.n, { |
OlderNewer