↓ Skip to main content

Posts

2013

Difference between matching and simple - Git push

·719 words·4 mins
Git message Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple Options for push.default nothing - do not push anything. matching - push all matching branches. All branches having the same name in both ends are considered to be matching. This is the default. upstream - push the current branch to its upstream branch. tracking - deprecated synonym for upstream. current - push the current branch to a branch of the same name. From SOF:

Sublime text macro to insert timestamp

·64 words·1 min
Sublime text macro to insert timestamp # platform-edc $ cat ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/time_stamp.py import sublime_plugin from datetime import datetime class TimeStampCommand(sublime_plugin.TextCommand): def run(self, edit): # formatting options at http://docs.python.org/2/library/datetime.html#strftime-strptime-behavior stamp = datetime.now().strftime("%Y-%m-%d_%H:%M:%S") # 2013-07-18 14:54:23 for r in self.view.sel(): if r.empty(): self.view.insert(edit, r.a, stamp) else: self.view.replace(edit, r, stamp) platform-edc $ Documentation - see

How to make screenshot from command line

·58 words·1 min
How to make screenshot from command line # platform-edc $ screencapture -i ~/Desktop/$(date +%Y%m%d%H%M%S).png libpng warning: zero length keyword libpng warning: Empty language field in iTXt chunk platform-edc $ screencapture ~/Desktop/A$(date +%Y%m%d%H%M%S).png libpng warning: zero length keyword libpng warning: Empty language field in iTXt chunk First one is “interactive” - Cmd-Shift-3 with selection tool, second is full screen

Case sensitivity and VirtualBox shared folder

·102 words·1 min
Case sensitivity and VirtualBox shared folder # Weird but true behaviour: I have the case sensitive encrypted disk (sparse bundle with HFSX type) mounted in VBox shared folders. All works fine, after VM starts: touch zz zZ creates two files, both “inside VM” ~/development/ATG/platform-edc as well as in OS-X. If the VM is suspended and resumed, it looses the case sensitivity inside the VM.

Usable mc color scheme

·10 words·1 min
Usable mc color scheme # Edit ~/.mc/ini insert [Colors] base_color=lightgray,blue:normal=blue,default:selected=white,brightblue:marked=yellow,default:markselect=yellow,gray:directory=brightblue,default:executable=brightgreen,default:link=cyan,default:device=brightmagenta,default:special=lightgray,default:errors=red,default:reverse=green,default:gauge=green,default:input=white,gray:dnormal=green,gray:dfocus=brightgreen,gray:dhotnormal=cyan,gray:dhotfocus=brightcyan,gray:menu=green,default:menuhot=cyan,default:menusel=green,gray:menuhotsel=cyan,default:helpnormal=cyan,default:editnormal=green,default:editbold=blue,default:editmarked=gray,blue:stalelink=red,default

Show lock screen indicator in OS-X menu

·51 words·1 min
Show lock screen indicator in OS-X menu # After HDD reinstall I lost most of my customizations (by choice decided NOT to restore from TM). The Lock in menu is provided by KeyChain Access, not by System Preferences. Open ‘KeyChain Access’ -> Preferences, select ‘Show keychain status’ and it is back:

ATG Development using 'hidden' VM

·699 words·4 mins
Brief description of my latest setup I use for CPL and LCH - in case I forget it or somebody wants to replicate it. Inspiration for the setup came from https://www.youtube.com/watch?feature=player_embedded&v=cPt_1Vga-Nk Motivation - issues with VMs # VMs are great - they allow “packaged” dev environment and quick start for the new member of the team. Start a VM on local or remote host, connect with VNC or Remote Desktop and you are in business.

Merge conflict with deleted file

·335 words·2 mins
I was merging the branch that removed / consolidated bunch of duplicate JSP files (corporate-ui-cleanup). In the meantime in master, some minor UI changes were made to these files whose content was now elsewhere. Quick trick how to resolve it fast: Show branch # CineplexB2B $ git show-branch ! [bb-database-cleanup] Loading data with XML only: no constraints and tax_id (unused field) nullable ! [bb-gradle-build] Merge branch 'master' into bb-gradle-build * [bb-master] Merged in the last 5 days changes ! [corporate-ui-cleanup] Merged in the last 5 days changes ! [master] Merged in the last 5 days changes ----- - [bb-gradle-build] Merge branch 'master' into bb-gradle-build ---- [bb-master] Merged in the last 5 days changes +*++ [bb-master^2] CPLXB2B-562, usageInfo/internalUsageInfo mapping in CFI +*++ [bb-master^2^] return order goes all the way to NEW: replaced SetPaymentGroupAmount, added ReturnFee calculator, added reusable jsp fragments for sales order pages +*++ [bb-master^2~2] Styling change to avoid disappearing links inside Terms and Conditions +*++ [bb-master^2~3] Dealing with consequences if INTERNAL split to INTERNAL_TRANSFER and INTERNAL_PURCHASE ---- [bb-master^2~4] Merge remote-tracking branch 'origin/master' into uat2-deploy ---- [bb-master^2~4^2] Merge branch 'master' of luke:cineplex-b2b +*++ [bb-master^2~4^2^] merged changes - fixed conflict +*++ [bb-master^2~4^2~2] CPLXBTOB-557 - fixed amount column to show proper currency ---- [bb-master^2~4^2~3] Merge branch 'master' of twgit@luke:cineplex-b2b.git +*++ [bb-master^2~4^2~4] CPLXBTOB-484 - fixed the spacing and comma issues +*++ [bb-master^2~5] Reverted 4d512ed - issue with recalculate. Must be solved selectively via Javascript +*++ [bb-master^2~6] Spacing in header see also version with --current

Pattern for test sourcing the script

·60 words·1 min
# Test if it is sourced or not if [[ $0 != .*bash ]]; then echo Please source it: . $0 exit 1 fi res=`gradle --version >/dev/null 2>&1; echo $? ` if [[ $res == "0" ]]; then echo Have gradle: `which gradle` gradle --version else export GRADLE_HOME=~/opt/gradle export PATH=$PATH:$GRADLE_HOME/bin echo No Gradle, adding - `which gradle` gradle --version fi

ATG Repository item linking and versioned repos

·632 words·3 mins
We have versioned repository ClientProvinceRepository that defines discount types based on account category pricelist and accounts - discountTypePriceList => (let’s not start discussion why this is not part of the pricelists). The item definition: <item-descriptor name="discountTypePriceList" display-name="Discount Type Price List" item-cache-size="1000" query-cache-size="1000" display-property="discountType"> <table name="CPLXB2B_DISCOUNT_PRICE_LIST" type="primary" id-column-name="DISCOUNT_PRICELIST_ID" > <property name="discountType" data-type="enumerated" column-name="DISCOUNT_TYPE" default="Base" queryable="true" category="Discount Price List" display-name="Discount Type" > <attribute name="useCodeForValue" value="false"/> <option value="Base" code="0"/> <option value="Silver" code="1"/> <option value="Gold" code="2"/> <option value="Platinum" code="3"/> </property> <property name="priceListId" column-name="PRICE_LIST_ID" repository="/atg/commerce/pricing/priceLists/PriceLists" item-type="priceList" display-name="List Price List" required="true" category="Discount Price List"/> <property name="salePriceListId" column-name="SALE_PRICE_LIST_ID" repository="/atg/commerce/pricing/priceLists/PriceLists" item-type="priceList" display-name="Sale Price List" category="Discount Price List"/> <property name="startDate" column-name="START_DATE" data-type="timestamp" display-name="Start Date" category="Discount Price List"/> <property name="endDate" column-name="END_DATE" data-type="timestamp" display-name="End Date" category="Discount Price List"/> </table> </item-descriptor> When I tried deployment with this, I got error