Skip to content

Instantly share code, notes, and snippets.

@skorp
skorp / xcode.increment.build.number
Created July 13, 2020 22:08
increment build number on ios
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}"
@skorp
skorp / multi_ssh
Created October 17, 2018 08:09 — forked from oafridi/multi_ssh
Multiple git ssh keys for two bitbucket accounts
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
@skorp
skorp / list js events
Created February 9, 2016 16:11
list js events:
//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;
@skorp
skorp / gist:d1cf548bd7901497ec71
Created January 14, 2015 10:40
see how many watchers on angular app
//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); })();
@skorp
skorp / resizeable
Created October 15, 2014 13:00
solves jquery ui zoom resizable problem with checking maxWidth and maxHeight
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;
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);
};
@skorp
skorp / gist:1820ec5fce25b43188a4
Last active August 29, 2015 14:03
sencha touch password confirm validation
Ext.applyIf(Ext.data.Validations , {
passwordConfirm: function (config, value) {
var password = Ext.getCmp(config.passwordField).getValue();
if(password !== value) {
return false;
}
return true;
}
});
@skorp
skorp / Produkt Parent
Created December 27, 2013 19:27
Parent is created like a Dropdown not a Treedropdown
public function getFrontendFields($params = null) {
$fields = $this->scaffoldFormFields(array(
'restrictFields' => array(
'Parent',
'Name',
'sortable',
'active',
),
'fieldClasses' => array(