These are my links for December 2nd through January 12th:
Tag: css
Cross-platform automated builds for node-webkit applications
Recently I’ve been extending my “classic” JavaScript knowledge by learning NodeJS. I’m sad to say that writing cross-platform, Desktop-class applications in Perl is just way too much hassle. However, having also discovered node-webkit I’ve been able to accelerate my desktop application development using classic HTML & CSS knowledge and improving my JavaScript techniques, mostly trying to better understand fully asynchronous, non-blocking programming. Apart from some initial mind-bending scoping experiences which maybe I’ll come back to another day, it’s generally been a breeze.
One of the useful things I’ve been able to do is to automate cross-platform application builds for Windows and Mac (Linux to come, not a priority right now but should be easy – feel free to comment). It’s not compilation, but more like application packaging.
My project has the node-webkit distributable zips in “src/”. The target folder is “dist/” and I’m also using a few DOS tools (zip.exe & unzip.exe and the commandline Anolis Resource editor) which live in dist/tools. The targets are built with timestamped filenames, a .exe in “dist/win/” for Windows and a .dmg in “dist/mac/” for OSX. I don’t do anything clever with Info.plist on Mac though I know I should, but the icons are set on both platforms, assuming they’ve been pre-generated and saved in the right places (resources/).
On OSX I’m using system make which presumably came with XCode. On Windows I’m using gmake which on my system came with a previous installation of Strawberry Perl but is also available in a Windows binary/installer.
My Makefile looks something like below (“make” not being one of my strongest skills – apologies for the ugly stuff). It might not be 100% complete as it’s been excised out of the original, much more complicated Makefile, so use with caution. If anyone has any tips on stuffing it all into NSIS automatically as well, please comment.
NW := node-webkit-v0.7.3
NWWIN := $(NW)-win-ia32
NWMAC := $(NW)-osx-ia32
NWLIN := $(NW)-linux-x64
deps:
rm -rf node_modules
npm install
windeps:
if exist node_modules rmdir node_modules /s /q
npm install
# zip.exe & unzip.exe from http://stahlworks.com/dev/?tool=zipunzip
# Resourcer.exe from http://anolis.codeplex.com/
win: windeps
if exist mdc.nw del mdc.nw /q
if exist dist\win rmdir dist\win /s /q
if exist tmp rmdir tmp /s /q
dist\tools\zip -r mdc.nw mdc package.json node_modules
mkdir dist\win tmp
dist\tools\unzip -d tmp -o src\$(NWWIN).zip
dist\tools\Resourcer -op:del -src:tmp\nw.exe -type:14 -name:IDR_MAINFRAME
dist\tools\Resourcer -op:add -src:tmp\nw.exe -type:14 -name:IDR_MAINFRAME -file:resources\mdc72x72.ico -lang:1033
copy /b tmp\nw.exe+mdc.nw dist\win\mdc.exe
copy tmp\icudt.dll dist\win
copy tmp\nw.pak dist\win
if exist mdc.nw del mdc.nw /q
if exist tmp rmdir tmp /q /s
dist\tools\zip -r dist\win\mdc-$(shell echo %date:~-4,4%%date:~3,2%%date:~0,2%-%time:~0,2%%time:~3,2%).zip dist\win
mac: deps
[ ! -f mdc.nw ] || rm mdc.nw
zip -r mdc.nw mdc package.json resources/mdc72x72.png node_modules
touch node-webkit.app
rm -rf node-webkit.app dist/mdc.app dist/mac
mkdir dist/mac
unzip -o src/$(NWMAC).zip
mv node-webkit.app dist/mac/mdc.app
mv mdc.nw dist/mac/mdc.app/Contents/Resources/app.nw
rm dist/mac/mdc.app/Contents/Resources/nw.icns
sips -s format icns resources/mdc512x512.png --out dist/mac/mdc.app/Contents/Resources/mdc.icns
perl -i -pe 's{nw[.]icns}{mdc.icns}smxg' dist/mac/mdc.app/Contents/Info.plist
perl -i -pe 's{node[-]webkit[ ]App}{MDC}smxg' dist/mac/mdc.app/Contents/Info.plist
hdiutil create dist/mac/mdc-$(shell date +'%Y%m%d-%H%M').dmg -ov -volname "MDC" -fs HFS+ -srcfolder dist/mac/mdc.app
rm -rf dist/mac/mdc.app
test:
@./node_modules/.bin/mocha
.PHONY: test
Bookmarks for June 1st through November 3rd
These are my links for June 1st through November 3rd:
- Meraki –
- Cambridge Wood Works – Recycling and Reusing Waste Wood In Cambridge UK –
- web-sorrow – a versatile security scanner for the information disclosure and fingerprinting phases of pentesting. written in perl – Google Project Hosting –
- Shades | Software | Charcoal Design –
- Welcome – Fritzing –
- PLOTS Spectral Workbench: index –
- Cubify – Express Yourself in 3D – basic reprap with a bit more polish
- LPMT – Little Projection-Mapping Tool | "Projection-Mapping for the masses" –
- CircuitLab – online schematic editor & circuit simulator –
- Nava Whiteford – SGenomics Ltd –
- Scalable Flash Memory Array – Violin Memory Violin Memory –
- All The Cheat Sheets That A Web Developer Needs | Top Design Magazine – Web Design and Digital Content – via @jitsukerr . Missing bits of perl and apache other than rewrite
- hashcat – advanced password recovery –
Bookmarks for January 17th through February 2nd
These are my links for January 17th through February 2nd:
- Instant Screen Sharing | Screenleap –
- Sofortbild – Mac Tethered Shooting –
- Your Mother Was a Chemist: Science in the Kitchen | Your Mother Was a Chemist –
- Try Jasmine in your browser, because downloading a zip file is too much work! – online/web-based coffeescript engine
- Bootstrap, from Twitter – frontend webdev toolkit
Bookmarks for October 4th through October 11th
These are my links for October 4th through October 11th:
- Heimdall – Glass Echidna –
- merc.com –
- Vagrant – Welcome –
- Compass –
- Cube – <p></p>
Bookmarks for December 7th through January 21st
These are my links for December 7th through January 21st:
Bookmarks for October 27th through November 15th
These are my links for October 27th through November 15th:
- HTML5 Presentation – Very useful intro-by-example to latest html5 features
- Page Speed Home –
- Krav Maga Classes in London Essex and Hertfordshire –
- The Official Gerald Scarfe Website | Buy signed prints & books – pricey prints
- HTTPS Everywhere | Electronic Frontier Foundation –
Bookmarks for April 30th through May 11th
These are my links for April 30th through May 11th:
- Meganet’s Dominator I snoops on four GSM convos at once, fits in your overnight bag — Engadget –
- SFBags – WaterField Designs – Muzetto Bags – Laptop Bag –
- LESS – Leaner CSS – looks just like Sass
- thiblahute/Gsoc2009 – GNOME Live! – synchronised google docs as a network drive
- GMDesk – run Gmail, Google Calendar, Google Docs and Google Maps as a stand-alone installable application –
Bookmarks for April 17th through April 20th
These are my links for April 17th through April 20th: