Delete already-Merged Branches on integration or master

Posted on December 19th, 2013 by thiswayup.
Categories: Development.

I always spend a few minutes on google how to do this so I thought I keep a reminder here. To delete local branches which have already been merged into master:

git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d

Thanks to



Getting my own status updates via Facebook graph api

Posted on December 12th, 2013 by thiswayup.
Categories: Development.

To get your own facebook status updates this is the graph query:



Fastest way to run a web server for development

Posted on November 30th, 2013 by thiswayup.
Categories: Web.

To future forgetful self, this is the fastest way to run a web server. To anyone else, you just need to navigate to the directory and run the command below.

python -m SimpleHTTPServer



JavaScript things to remember #0

Posted on August 26th, 2013 by thiswayup.
Categories: JavaScript.

Amongst my interests at the moment is JavaScript and as I've got the worse memories in the world, I've decided to embark on doing a series of JavaScript related posts for my future self. I find committing stuff like this to paper writing helps the old synapses fire :)

It took 10 days to write JavaScript

For the first piece thing to remember is as a piece of trivia. Brenden Eich wrote the first js in 10 days in May 1995. I think it's probably important to remember as everytime I curse about js I remind myself about this fact. I also remind myself it's not the language, it's how you use it.

"arguments" parameter

WIthin every function is a arguements, try it!

function test() {
    var args = arguments;
    for (var i=0; i < args.length; i++) {

test("a", "b", "c");

Note also that "arguments" is an object and not an array. Array.slice it to break it down to an array.


Missing path to get Titanium Alloy Template working in Studio

Posted on June 24th, 2013 by thiswayup.
Categories: Mobile Dev.

After having lots of issues on Titanium Studio and getting the Alloy templates showing up, I finally found the reason for it now showing. It was down the npm install path folder (which Studio uses to figure out if Alloy is installed) was missing.

The following command fixed it:

export PATH=$PATH:/usr/local/share/npm/bin

Hope this helps someone


Debugger keyword in Appcelerator Titanium

Posted on June 17th, 2012 by thiswayup.
Categories: Mobile Dev.

I've been using Appcelerator Titanium for the past year to play around building Iphone apps, whats good about it also builds to Android.

I've just realised you can use the "debugger" keyword in code to set a breakpoint. This is different from just adding a breakpoint via choosing a specific line to set a breakpoint, since as soon as you add/remove any code before that line, it then stops that break point working,


how to change host and apache conf files for MAMP

Posted on May 27th, 2012 by thiswayup.
Categories: Development.

I use MAMP for my OSX dev, the regular edition doesn't include the easy way to add to the host file (so that you can have a dev domain eg and virtualhost to the apache.conf, you need to do it manually. But luckily it is very easy, this is for my future self to save finding it on google.

Adding to the host file

sudo cp /etc/hosts /etc/hosts.bak

sudo nano /private/etc/hosts

Add virtualhost

location: Applications/MAMP/conf/apache/httpd.conf

Add a virtual host

example entry:


 ServerName hib.local

 DocumentRoot "/Users/joelee/Sites/hub.local/web"

 DirectoryIndex index.php



Quake like drop down terminal for Mac OSX

Posted on March 28th, 2012 by thiswayup.
Categories: Development.

SInce I started using Mint Linux, I have been steadily getting more drawn to the command line and love using Guake to quickly access it. It draws its inspiration from the game Quake, where the terminal drops down from the top of the screen. Through Guake, I can create multiple terminal windows and access it via a shortcut that drop them all down from the top of the screen and allow for multiple windows.

I've been looking around for something similar and found Totalterminal from Visor. Does pretty much the same thing, thoroughly recommended!

They also do a fantastic Finder replacement (allows for tabs and "cut n paste, for example) called Totalfinder


Full frontal JavaScript conference in Brighton

Posted on November 27th, 2011 by thiswayup.
Categories: Development.

Full Frontal is a JavaScript conference focused predominately on the front end, this is a jumble notes and reflection on it. After missing it last year, I made it a point to get a Full Front conference as early as possible and join in the early bird tickets, an absolute bargain at £120. 

Warm up at asynch.js meetup

Having lived in Brighton for a few years in my Uni years, I was quite keen to get down there as soon as I could and get a nice bit of sea air. I travelled down the night before so I can attend the local javascript meetup, Asynch.js which is run by the rather nice chap Prem. The night was a lightning talk type setup for a show and tell session. I got there late so only saw half the talks but I managed to see a couple of interesting things including:

  • An AR app built with my fave development platform Titanium
  • A Phonegap based framework
  • Json library implementing the extended verbs of REST. 

Since there was over 70 people signed up on Lanyard, there was quite a few people who ditched the idea and went straight to the pre-conf social (ok get drunk at the pub).

The conference setup

The venue was the Duke of York Picturehouse and it was pretty damn cool. Very handy having it at a cinema with comfy seats and a gigantic screen behind the speaker. There was the one main track and everything ran really smoothly from what I can tell. I'm always impressed when I attend events like this with so much co-ordination involved and having it go off without any major hitches. Well, at least I didn't see any :) Ofcourse there was the issue with the Wifi, but we were told well advance of the issue. Maybe they should look at multiplexing a load of usb wifi dongles :)



I was amazed by the quality of the speakers, the content was overall nothing short of spot on. I felt I wasn't really disappointed by any of them. The range of topics covered ranged across the spectrum from very technical to architectural and ones which left you a nice warm feeling inside. As a quick round up on the ones that were my fave of the day.

CoffeeScript deign decisions (Jeremy Ashkenas)

A very good speaker and great intro to Coffeescript by non other then the guy who created it. I really like this talk as he stepped through the construction of the language through a deconstruction of javascript and also sanitising it, resulting in the output that is coffeescript.  The examples was really easy to follow as he went through all the basic stuff to more intermediate subjects. It was very interesting showing the coffee script followed by the "compiled" js output. Only downside was I would have probably taken more of it in if it wasn't the first talk and I was just waking up! Note to self, need extra shot of expresso next time.

     memorable tweet: "Intense and great talk on #coffeescript "hunger gotted""

Scalable Java Script Applications Architecture (Nicholas Jakas)

As I get (slightly) more mature as a developer, I am starting to think about the bigger issues of approaching builds in a sustainable and robust manner, I sometimes wonder about this thing called architecture. I was really looking forward to this talk and as a fellow attendee commented "This guy knows his sh*t". Nicholas outlined an approach which essentially decoupled your components with a three tier layer along with guidelines on what each layer should be comprised of. Good stuff and really enjoyed it. Hoping to have a chance to use some of the ideas in an upcoming project


Beyond the page

Glenn gave a talk on using the built in state of the various types of drag/drop things you can do within and between browsers. It was really interesting to see a the demo of the current integration between applications (ie between different browsers and desktop) and the ability to interact at different levels. His practical example was an online social address book through dropping in urls into (and between different!) browsers which automatically brought up user information from various sources. This type of interaction automatically created profiles on the user through sources from social graphs and I think linkedin . 

I kept on thinking about the Microsoft nirvana of data integration across it's various desktop applications A source of some of the worse viruses and worms sure, but wouldn't it be so good to have your data free and the "intent" realised by such a casual action of drag and drop? All achievable without manual bumming around by the user? He rounded the talk nicely with a bit of history from the old Lotus 1-2-3 days. Discussing briefly the point of how the accountants gained creative independence, data ownership, and portability which was the reason why Lotus became so successful.

Memorable tweet: 

Having a "how the hell do you do that?!!?!" moment with the beyond the page talk #awesome #fullfrontalconf"


Beyond the Planet of the Geeks (Brendan Dawes)

A bit more "airy fairy" non-technical section where Brendan gave a very entertaining talk on experimenting and playing with ideas with a strong sense purpose and iterative/evolutionary development. He used a real client project as a case study on the ways in which continually iterating a basic idea can lead to some interesting results. I felt he was drumming into us the idea that passion and playing ultimately leads to a satisfactory outcome. However from my perspective, only possible providing you can afford to keep chucking enough resource at it. It was interesting to note how he decided to drop his Flash skills and step out of his comfort zone to build the case study project completely in HTML5. I now know more about pencils and paper clicks then before as well.

Memorable Brendan line: "whoever said a bad workman blames his tools was a moron and I want to smash his head in with a beautifully made hammer"


You gotta do what you gotta do (Marcin Wichary)

The last talk was a really fun and quite inspirational talk from one of the user experience designers at google talking about google doodles. What grabbed me about the talk was the amount of time, effort and detail they go into each one as it only essentially lasted a day! To give a sense of the effort involved with relation to the number of lines of code:


  • 2009: 1
  • 2010: 5000
  • 2011: 13000

One of the doodles mentioned was the famous pac man doodle. I hadn't known that Pac Man was actually a deterministic game, I had always thought it was random. So Marcin decided to program it as the original. What was quite surprising was that people had figured that out through reverse engineering the code and created a counter algorithm to it. Remember these things are on for less then a day!

He then went through the design iterations of various other ones, one of the ones which stuck out was the celebration of Martham Gratham doodle. Pushing the boundary of sprite animation to a whole new level! I wish I could find a picture of the overlay of the different sprites on top of each other, it was rather cool. What was built wasn't a complete bed of roses mind you. It's nice to see the humbleness of individuals such as Marcin when he showed examples of how he had to build things in an often less then optimal way (sometimes often broken code), just to get the main point across "If you code doesn't feel a bit nasty, you are probably behind".


In Conclusion

The conference turned out to be a lot more fun and beneficial then I imagined. As I mentioned before the quality of the speakers was superb. The in between random chats and networking fun was one of the main reasons to come to these things, the free bar after was an absolute bonus! The size of the conference was good but I feel that the temptation to make it bigger is going to make it hard for it to stay this small, this could easily be twice the size! I hope it stays at this size for next year.

I felt there was a really strong sense of community from talking to all sorts of people from a range of different backgrounds and doing different things. All willing to dive deep into what they're doing. In the space of a fairly short conference I was talking to js developers in various industries building different things from mobile native, mobile web, games and embedded systems. It just goes to show how diverse js is and where it touches.

Though I think I could be breaking some kind of taboo to quote my own tweet, I think overall I had described the experience it best in less then 140 characters:

"Today I feel inspired, learnt something new, amazed, down trodden(how little I know) and more driven. thank u #fullfrontalconf and @rem"


Titanium.UI.currentTab is null?

Posted on November 18th, 2011 by thiswayup.
Categories: Mobile Dev.

For some reason Titanium.UI.currentTab sometimes returns null and you need a work around by defining it on a focus event on the tabGroup as a work around.

One of the pains with Titanium is the rather random situations when the built in properties for certain objects aren't set. Spent another hour looking at this same bug again and as soon I figure it out the saying ""Fool me once, shame on you; fool me twice, shame on me" rang loudly in my poor head.

This time I thought it best to write this down, to remind myself (and anyway one else).