This file contains hidden or 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
FOR /R FOLDERNAME %X IN (.svn) DO (RD /S /Q "%X" 2>nul) |
This file contains hidden or 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
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 |
This file contains hidden or 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 escapeSpecialChars(jsonString) { | |
return jsonString.replace(/\n/g, "\\n") | |
.replace(/\r/g, "\\r") | |
.replace(/\t/g, "\\t") | |
.replace(/\f/g, "\\f"); | |
} |
This file contains hidden or 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
.directive('contenteditable', function () { | |
return { | |
restrict: 'A', // only activate on element attribute | |
require: '?ngModel', // get a hold of NgModelController | |
link: function (scope, element, attrs, ngModel) { | |
if (!ngModel) return; // do nothing if no ng-model | |
// Specify how UI should be updated | |
ngModel.$render = function () { | |
element.html(ngModel.$viewValue || ''); |
This file contains hidden or 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
/** | |
* Traverses a javascript object, and deletes all circular values | |
* @param source object to remove circular references from | |
* @param censoredMessage optional: what to put instead of censored values | |
* @param censorTheseItems should be kept null, used in recursion | |
* @returns {undefined} | |
*/ | |
function preventCircularJson(source, censoredMessage, censorTheseItems) { | |
//init recursive value if this is the first call | |
censorTheseItems = censorTheseItems || [source]; |
This file contains hidden or 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
// Console.save | |
(function(console){ | |
console.save = function(data, filename){ | |
if(!data) { | |
console.error('Console.save: No data') | |
return; | |
} |
This file contains hidden or 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
adb shell pm list packages | |
adb shell pm path com.example.app |
This file contains hidden or 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 listDir(path){ | |
window.resolveLocalFileSystemURL(path, | |
function (fileSystem) { | |
var reader = fileSystem.createReader(); | |
reader.readEntries( | |
function (entries) { | |
console.log(entries); | |
}, | |
function (err) { | |
console.log(err); |
This file contains hidden or 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
// Windows - inside c:\openssl\bin | |
keytool -exportcert -alias androiddebugkey -keystore debug.keystore | ".\openssl.exe" sha1 -binary | ".\openssl.exe" base64 |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |