Find it

StormGate Ltd & 2012′s Major Project


3rd Month in to 2012 and wow, how busy it has already been! New, fresh starts have come in the form of a new company (StormGate) doing new things (to find out what you will have to watch this space and follow here)….even Facebook is appreciating the developments, unrolling the red carpet on timeline’s for pages. Lets make this year big, lets do something, lets create something amazing.

“One extends one’s limits only by exceeding them”

M. Scott Peck, who wrote amazing things.

Posted in Business, Facebook Pages, Looking Forward, Projects, Social Media, Web Technology Tagged , ,

1and1 Web Hosting & Git – Installing it for singular dev

I have a new project in the works and I thought it about time to get a verioning setup working beyond locally, I don’t want to use a PaaS (like Cloud control) though for this one as its Top Secret (for now.) Yeah Yeah I know, shared web hosting, 1and1 – not so secret eh? Well behind a .htaccess passworded directory is better than sitting on AWS via a PaaS, it is, believe me.

The benefit of using GIT in the way below is that it maintains version history AS WELL as offering a managed host, i.e. it deals with uploading as well as versioning (in 1 git bash push.)

So here’s the scenario – there’s one of you, or maybe a few core founders/dev’s and you want to use GIT to version control your developments of a new web app or site. You already have a shared hosting account with 1and1 which works fine up to 20k hits a day or so, is there really need to have the thing scalable on demand from day one? No? Great, read on. If you REQUIRE scalability off the bat (I bet you don’t, really) then go find a PaaS/jump on AWS, for now here’s how to get GIT versioning (with automatic publication) working on your 1and1 shared hosting.

Firstly go read this, its a great guide that pretty much* got me there (95% of the credit to Abhijit), there’s just a few changes to get it to work on 1and1.

How I did it: GIT on 1and1

Load up your FTP, get to the root of your hosting and make your main site dir, in this case we will call it AppDev1:
/AppDev1
Next make two directories underneath it: “repo” and “live”, I shall explain these after you have made them:
/AppDev1/live
/AppDev1/repo

What these two are going to do is give you a live “root” for your web app/site as well as a GIT repository (which stores all the changes.) By separating them you keep everything simple. [live = web root folder, repo (or whatever you call it) = git bare repository.]

Next locally (on your machine) create a folder which you want to develop in:
C:/EpicNewApp

…And load up GIT BASH (assume you have) and enter the following:
cd "C:/EpicNewApp";
git init;

Next go ahead and load your SSH client (putty) and log into your 1and1 Account (there is guidance on 1and1 under SSH accounts, if you need it.) Once logged in enter the following:

cd "/AppDev1/repo"
git init --bare
cat > hooks/post-receive
#!/bin/sh
GIT_WORK_TREE="../live" git checkout -f
chmod +x hooks/post-receive

*note: This differs from the aforementioned guide in the address entered under GIT_WORK_TREE, this is the only way I could get this setup to work on 1and1.

You can also simply stick these lines into a file called post-receive and upload the file to the “hooks” folder of your new bare repository (repo), if you are so inclined.

That’s it, your done with the SSH, now you can bind a remote location in GIT BASH (replace the obvious:)
$ git remote add web "ssh://u99999999@yourMain1and1Domain.com/~/AppDev1/repo/"
…And go ahead and push to 1and1 (you will need your SSH password to do so.)
$ git push web +master:refs/heads/master
All being well this should have pushed a version to your /AppDev1/repo folder and also updated the live files as per your changes!

Happy Ghetto Versioning!

Note: As per comments, removed .git reference from link, thanks Ano.

Posted in Code, Projects, Snippets, Web Development, Web Technology Tagged , , ,

Recent Projects, Top Freelancer People Per Hour

I am Top 1 of 169,000 freelancers for November!

It was a busy November, but it paid off – completed a good few projects for some great clients, and whats more I won no# 1 Top Freelancer @ people per hour!

You can read more about some of my recent projects here, although there’s only a few case studies up, the most public of the projects was a great life planning app that I built to first iteration, you can check it out (DO IT NOW!) @ 5years.me – built in the cloud on PaaS, behind the scenes I have also helped develop a social media analytics platform that is a marketeers wet dream, maybe as it gets properly released I will divulge more on that. Needless to say November was a great month of good work for great clients – off the radar now until my big project in early 2012 :D

Life Planning Web App Built in the cloud (cloudcontrolled.com)
Posted in Looking Back, PHP, Projects, Web Development, Web Technology Tagged , , , ,

IP to Location Alternative: Javascript – Using JS to find Browser Country / Location not from IP

Know your audience? Got google analytics aggregating their details? Great, good for you! But doe’s that add any value in the short term? Improve THEIR browsing experience? In the long run you should use analytics to achieve better sites (although many don’t) – but for now, right here you can still add some of the future frill. Take this situation: You want to show different content/additional content to each nationalities (maybe aim for a few – US, UK, AUS) – Did you know that adding a national flag that a user can associate with may increase sales up to 20%, or More? Go read Ca$hvertising. In any case if your sitting comfortably, take a look below for the how to!

Mars Landers on Map
Javascript – Using JS to find Browser Country / Location not from IP Photo by ToastyKen
Posted in Javascript, Snippets, Web Development Tagged , , , , , ,

Did you know: Facebook short url’s already kinda exist

As a side note: facebook shorturls, or at least abreviated urls exist. We all know about fb.me, but fb.com works too…. Random occurance:

Was saving down facebook data into a database from the graph api, wanted to save the urls in a mixed url table but didn’t want to bother saving the whole http://www.facebook.com every time, what a waste of data. Initially I lazily abbreviated this too: fb.com/whateverthepagewas, left the acquisition stuff to its job and then went off to do something else. Coming back to the management system I accidentally clicked one of these fb.com/ links, and it worked! Facebook have set it up as a redirect. Maybe this was common knowledge but I hadn’t heard of it before…Anyhow a useful biproduct of dataspace savings!

So check it out: fb.com/hayday

That will redirect you too http://www.facebook.com/hayday (my page.) – just like fb.me, but traditional-like, lol. Neat eh? Anyone else know any facebook quick wins?

Posted in Facebook Pages, Projects, Web Development, Web Technology Tagged , , , ,

Abstract Autumn: Animal Structures

fire rowers

On their way

Velc

Myst

dry water

See the rest of Abstract Autumn, Addictive @
my photostream

Posted in Photography, Photography Tagged , , , , ,

MySQL datetime examples – first/last day of the year – dates and unix-times

For some reason I had an abstract memory of SQL SERVER 2000, timestamps and pain. Who knows why. Perhaps its a faulty memory. lol. Anyhow working with timestamps in MySQL/MSSQL these days is nothing short of simple. With MySQL Workbench free its ridiculous how far the barrier of entry for database design has come, its now all pleasant schema’s and error messages that make sense, gone are the days of spending half the time fixing/navigating the database system, they just work now (99% of the time) what a lucky generation of programmers! Anyhow here’s some datetime examples that you might find useful:

Get last day of last year – obvious, but still (+1 this for first day):

SELECT DATE(CURDATE()- INTERVAL DAYOFYEAR(CURDATE()) DAY);

And how useful… FROM_UNIXTIME takes a unix timestamp and makes it a friendly datetime, its like they KNOW I am coding for facebook data acquisition…Anyhow…

To make a GMT UNIX time-stamp for the first day of this month:

SELECT UNIX_TIMESTAMP(CONVERT_TZ(DATE(CURDATE()- INTERVAL DAYOFMONTH(CURDATE()) DAY), '+0:00', 'SYSTEM'));

You can switch out the dates obviously, and there are probably other ways, still, mostly pain free.

Posted in Snippets, SQL Server, Transactional SQL, Web Development, Web Technology Tagged , , , , , , , ,

Fix/Hack to make AutoSuggest JQuery Plugin work

When I came across Drew Wilson’s flashy JQuery Autosuggest plugin I happily downloaded the code and started using it within a recent project, but as I used it more and more I kept hitting a bug – don’t know if its just the version of JQuery I was tied to using or whether everyone using the pretty plugin suffers it. Either way there was peculiar happenings when removing elements, they would remove 75% of the time, but the other 25% they would remove only to not maintain the associated CSV list of objects properly.

Irritating when the thing looks so pretty out of the box. So rather than opt for one of the non-pretty options I just hacked it. Brutally I just added code to maintain an input as a csv, it needs fixing really but this does work, for now.

Click here to download my hack/fixed version which maintains a separate csv (in a designated ID – search replace “csvHolder” if you want to change its ID.)

Hopefully Drew can update his plugin so it works out of the box, its a really useful plugin.

Note: This rar includes my csv quick maintaining functions which are required.

Posted in Javascript, Web Technology Tagged , , , ,
Got a Project?
A Quote..
"You can't have 5 north stars"
???
© Woody Hayday 2012