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
| FILENAME=Info.plist | |
| INFO_PLIST=${PROJECT_DIR}/${TARGET_NAME}/${FILENAME} | |
| if [ ! -f $INFO_PLIST ] | |
| then | |
| echo "No PLIST FILE found, build number can't be incremented." | |
| exit 1 | |
| fi | |
| buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${INFO_PLIST}") | |
| buildNumber=$(($buildNumber + 1)) | |
| /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${INFO_PLIST}" |
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
| workid and personalid: | |
| 1. Edit the ~/.ssh/config file | |
| Add an alias for each identity combination for example: | |
| Host workid | |
| HostName bitbucket.org | |
| IdentityFile ~/.ssh/workdid | |
| Host personalid | |
| HostName bitbucket.org |
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
| //http://stackoverflow.com/questions/743876/list-all-javascript-events-wired-up-on-a-page-using-jquery | |
| (function($) { | |
| $.eventReport = function(selector, root) { | |
| var s = []; | |
| $(selector || '*', root).addBack().each(function() { | |
| var e = $._data(this, 'events'); | |
| if(!e) return; | |
| var tagGroup = this.tagName || "document"; | |
| if(this.id) tagGroup += '#' + this.id; |
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
| //Read more at http://www.airpair.com/angularjs/posts/top-10-mistakes-angularjs-developers-make#E0XQSC2c6Ckbl21t.99 | |
| (function () { var root = $(document.getElementsByTagName('body')); var watchers = []; var f = function (element) { if (element.data().hasOwnProperty('$scope')) { angular.forEach(element.data().$scope.$$watchers, function (watcher) { watchers.push(watcher); }); } angular.forEach(element.children(), function (childElement) { f($(childElement)); }); }; f(root); console.log(watchers.length); })(); |
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
| var hotspotZoomScale = 1; | |
| var _methodName = $.ui.resizable.prototype._respectSize; | |
| $.widget("ui.resizable", $.extend({}, $.ui.resizable.prototype, { | |
| _respectSize: function(data,event) { | |
| if(hotspotZoomScale != 1) { | |
| var changeWidth = data.width - this.originalSize.width; | |
| var newWidth = this.originalSize.width + changeWidth / hotspotZoomScale; | |
| var changeHeight = data.height - this.originalSize.height; | |
| var newHeight = this.originalSize.height + changeHeight / hotspotZoomScale; |
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
| var container = document.getElementById('answer'); | |
| for(var i = 1; i <= 5; i++) (function(n) { | |
| var a = document.createElement("a"); | |
| a.innerHTML = "link" + i + " "; | |
| var onClick = function () { | |
| alert(n); | |
| }; | |
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
| Ext.applyIf(Ext.data.Validations , { | |
| passwordConfirm: function (config, value) { | |
| var password = Ext.getCmp(config.passwordField).getValue(); | |
| if(password !== value) { | |
| return false; | |
| } | |
| return true; | |
| } | |
| }); |
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
| public function getFrontendFields($params = null) { | |
| $fields = $this->scaffoldFormFields(array( | |
| 'restrictFields' => array( | |
| 'Parent', | |
| 'Name', | |
| 'sortable', | |
| 'active', | |
| ), | |
| 'fieldClasses' => array( |