how to change host and apache conf files for MAMP

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

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 mylocal.dev) 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:

<VirtualHost 127.0.0.1>

 ServerName hib.local

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

 DirectoryIndex index.php

</VirtualHost>

0 comments.

Quake like drop down terminal for Mac OSX

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

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

0 comments.

Good web page capture plugin for chrome

Posted on February 11th, 2012 by thiswayup.
Categories: Gadgets.

I've decided to recently try capture sites as reference for ideas for future projects. Being lazy I wanted a way to easily capture a whole page and maybe add notes to it in a quick manner in a central place. In the end I decided to use a chrome plugin and my fave note taking app Evernote. 

I was very tempted to use the Evernote clipper but it's very focused on grabbing just the text and larger images, missing out a few of the smaller elements. which causes the page to break from the original layout, 

The Chrome plugin I use is called Screen Capture (by Google) which essentially allows you to go to a page and capture it in a few ways, by region of a page, visible area or the whole area. Once captured you can augment/edit your capture it. Some of my favourite features include being able to highlight sections and add text on top in various colours. You can save the pic and then just add it to which ever notebook.

Hope this help all site layout/design hoarders around the world!

0 comments.

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 :)

 

Presentations

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"

0 comments.

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.

http://developer.appcelerator.com/question/98501/titaniumuicurrenttab-is-null

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). 

0 comments.

Over The Air mobile conference 2011

Posted on October 9th, 2011 by thiswayup.
Categories: dev.

I had the pleasure to attend the Over The Air conference this year. It's essentially a free conference over a couple of days where there are speakers during the day who talk about things relating to mobile during the day time and a hackathon during the evening/overnight. In previous years it has been held in universities in London but thy managed to secure Bletechly Park, home of the code breakers that broke the German Enigma code in WW2.

This was my first year and I couldnt attend the beginning sessions on Friday but managed to swing by in the Friday late evening to attempt to partake in the  Hackathon. Unfortunately big fail on my part when I gave up around midnight after trying to hack around the last.fm api to create a silly app idea. Note to self, must not do a full day worth of work followed by drinks before attempting to start a Hackathon! I ended up hanging out with some cool geeks chatting away till the early hours of the morning before realising that the gates was CLOSED! Bad news for me as I had booked a B&B and everyone else was sleeping in bean bags/sofas in Bletechly Park mansion. So I jumped the gate :)

The Saturday  was alot more successful for me as I managed to go to some rather good talks and had a good old geek out with both developers and non-developers. Some of my highlights:

  • Making of the FT Web app - interesting insight on how Andrew Betts talk about how to create a touch optimised HTML5 mobile website. Very interesting points highlighted in terms of cross browser challenges and things such as how to create animation of pages flipping to trying to master text flowing. The result is a product that has a higher number of usage then the native apps.
     
  • Mobile payment types from Anthony Hicks, Paypal - There's more payment types offered then I had realised. Good overview on what was on offer.
     
  • Mobile Augmented Reality from Frank Angerman, Junaio.com - A presentation on a very interesting mobile AR platform that has a REST API. Shows potential building some very cool mobile apps! It's stuff like this that blows my mind and they give it away for free!
     
  • hasblue.com - An Api for sms messages from O2
     
  • Twilio - A telephony API service with an api online.
     
  • Hackathon - The MAJOR highlight of the day. I saw stuff from someone creating
    • An analogue payphone connected to a locked Android mobile
    • A arcade grabber that was built using lego connected to Pay Pal
    • Phone based audio guide of Bletechley Park
    • Location aware reminder service

All in all pretty damn awesome!!!

0 comments.

Titanium Mobile App development and london web cruise

Posted on September 22nd, 2011 by thiswayup.
Categories: Mobile Dev.

I had an absolute ball at the London Web Meetup annual cruise where we set sail from Westminster, going back and forth between Putney and Greenwich on a nice river cruise. Always a blast having a bunch of geeks, booze and pizza whilst chatting over a range of subjects.

On the subject of talks, there was a chance of some lightning talk spots and I decided to give it a go with a very rushed presentation of my current fave platform, Titanium from Appcelerator. Titanium is a platform that allows you to build Iphone, Android and Blackberry mobile apps using javascript. Unlike Phonegap, it translates the UI elements into native controls which gives it a more native feel and generally faster response. I also feel that the offering though has a few annoying bits, will have a great future for knocking up apps in record time.

My talk can be found here on Slideshare here (be warned, may contain lots of mistakes).

Passing by Big Ben whilst I do my lightning talk Titanium presentation

Doing my talk as I'm passing by London Bridge
Courtesy of @gelle

1 comment.

Symfony 1.4 – Creating old sql tables when running build command

Posted on July 31st, 2011 by thiswayup.
Categories: Development.

Dear future self (and whoever it may concern).

You may recall that Symfony has a rather nifty feature to build your models and db from the YML file. If you rename any of the tables through YML, the old model classes are not deleted (see "flushed") from the "lib\model\doctrine" directory. Symfony's process seems to be create sql from the base classes existing in the above directory.

To solve this run the "symfony doctrine:delete-model-files" or just delete the files in "lib\model\doctrine". They really should have added the deleting of model files in "symfony doctrine:build --all"

1 comment.

mysql stupid errors – ERROR 1005: Can’t create table {table name} (errno: 121)

Posted on July 21st, 2011 by thiswayup.
Categories: Development.

So I've spent at least half a day trying to figure out a stupid error when synching (creating) between my mysql workbench schema to a mysql database. I was receiving an error :

ERROR 1005: Can't create table {table name} (errno: 121)

I worked out that the issue was the foreign keys but had no idea why it was tripping out! Turns out that you need to name the actual foreign keys uniquely themselves. Therefore Ive taken to adding the table name in front of the foreign key name ie

BAD = "FK_title" if there is another table with the same foreign name, you'll get the above unhelpful message!

GOOD = "actor_FK_title" as you cant have two tables with the same name, you;re safe in the knowledge that you wont have a dupe FK.

0 comments.

Writing PDO prepared statements in Modx to import CSV files

Posted on June 12th, 2011 by thiswayup.
Categories: Development.

Here's a small note for myself (and anyone who just wants to knock up a quick query using XPdo and Modx Revolution). Xpdo is the ORB (Object-relational bridge) or ORM that Modx Revolution has adopted as its standard way to abstract all the data access. It also provides a thin wrapper around the standard php PDO class.

I myself like writing SQL, especially when you have to write slightly more complicated sql which an ORM just becomes a hindrance in certain situations. Recently I've had to deal with uploads of CSV files directly into Modx, here is my code for the csv file read and using the handy PDO prepared statements bit.

Some points to note when using PDO :

  • Outputting the actual query used is not possible by normal methods (ie you cant dump the string value) , you have to log the queries used on mysql. This is because the actual query is prepared in mysql with values being passed to mysql after.
  • I recommend using the colon place holders eg ":dataValue" as this aids in readability.
  • You do not need to escape the query as prepared statements doe this for you.
  • Remember in the bindValue call to add the third and possible forth parameter. This defines the data_type and length of the datatype, otherwise mysql will not know how to type the value during the query being run. I always forget this after an extended period of not writing prepared statements and its a pain in the ass to debug, ref : "what the hell is wrong with this insert statement !?!?!?"

Here is some sample code for :

$file ="var/someplace/file.txt";
$handle = fopen($file, "r");
    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
        $stmt = $modx->prepare(
                "INSERT INTO modx_pews_buffer (event_group, month,event_date,event_descrption,event_start_time)
                VALUES (:grp, :month,:date,:des,:time)");
        $stmt->bindParam(':grp', $data[0],PDO::PARAM_STR,200 );
        $stmt->bindParam(':month', $data[1],PDO::PARAM_STR,50);
        $stmt->bindParam(':date', $data[2],PDO::PARAM_STR,200);
        $stmt->bindParam(':des', $data[3],PDO::PARAM_STR,30);
        $stmt->bindParam(':time', $data[4],PDO::PARAM_STR,11);
        $stmt->execute();
    }

Also read up :

Was listening to this whilst writing this post.

0 comments.

live chat with russian bride Evgenia, age 22 read on the Internet . For Ergonomic office chairs and Seating from ENDO Direct. . visit our source at http://dreamjb.net to get all iPhone unlock how to guides