Starting Apache on Mavericks

As of Mountain Lion and Mavericks you cant start apache off the share menu in system preferences. If you want to start it manually go the the terminal and type:

sudo apachectl start

But, if you want it to start on every launch you can add it to the launch agent by the following:

sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

The -w is to make it permanent. And ofcourse if you want to remove it again, just change load to unload.

Use 360 controller with Super Meat Boy on mac

Team Meat wrote that it wouldnt be possible to use your 360 controller with SMB. Even if you used an app like gamepad companion the mappings would be skrewed.

Though, if you go to:

/Users/{YOUR_USERNAME}/Library/Application\ Support/Steam/SteamApps/common/super\ meat\ boy/SuperMeatBoy.app/Contents/MacOS/buttonmap.cfg

and delete the mappings for gamepad you’ll be able to use gamepad companion or any other program like it. At least it worked for me.

Also you’ll need the osx driver for 360 controllers to work. You can grap it here.

Instagram PHP Wrapper

So today I finished up my Instagram wrapper. Instagram has become very popular over the last year or so but it still doesnt have a proper api wrapper for php. So I made one of my own that fits right in to Zend Framework since thats my framework of choice. You can ofcourse use this with other frameworks or standalone. It depends on a few components off Zend Framework though.

See it here https://github.com/ranza/instagram

Trigger setInterval immediately

Its probably common knowledge that you can do this, but I didn’t know that you could. This is a great way to trigger a function at the beginning of a `setInterval`. As you might know `setInterval` triggers after the given millisecond. So what this does it that it triggers it self at the beginning and returns it self as a function to `setInterval`.

A new hope

Getting over a breakup is never easy. Specially when your life isnt
exactly what you’ve hoped for. That’s pretty much the situation I was
in. Burned out at work and nothing to look forward to. It’s hard to see
the great things in life in such situations.

A month ago I started my new job at [Duckling](http://duckling.dk)&[Sonne](http://sonne.dk), the sister company for [M2Film](http://m2film.dk). The start was hard since i wasnt really my self. But I found a pretty good rhythm and stuck with it. Got up two hours before work started. Took a long bath and tried to comedown and collect my thoughts. Then a good 30 minutes meditating and blanking out my mind. Then a bit of tvshows while eating breakfest. It takes a about 20 minutes for me to bike to work, and then our great coffee guy Sam makes an amazing strong coffee.

The new job has been amazing. All the guys at work have been so sweet
helpful. We have played a bunch of Street Fighter 4 and been drinking a
lot of beers after work. I never knew how important it was to have a
culture at work that supported getting away from the screen. Not just
that but having an overhead is a big stress release. Nobody looking over
your neck and checking every little detail you do. This is a big
motivator especially for me. And also just the fact that the company is
stable. Not be involved or knowing things about the economics in the
company makes you feel more safe.

People are happy here. No need to feel that you have to up your game all
the time. It’s a very relaxed place.

Im getting there.

Vim + Ack = WIN

I might be a bit late to the ack game but holy shit its amazing. I had a huge app i needed to search for a class and make a quick edition every where. `grep -R` is great but then a friend told me to use ack and better yet `vim.ack`. I quickly grapped the plugin and installed it. Then ran `:Ack myclass` and boom a list of the files i needed to edit. Grep the plugin here

Ack also comes in a cli tool and can be installed with `brew install ack`

Pipe a gzipped mysql dump over ssh

I had a problem with a server without any space left on the drive, but still had to dump a database. So what i did was pipe the output of `mysqldump` to gzip and then send it over ssh to another server.

`mysqldump` outputs clear text so lets send that to gzip. We need to tell gzip to output the result to stdout so we can pipe it to ssh. We can do this by adding the -c option. Last we need to send it over ssh. You can pipe it over ssh by simply doing `ssh user@host ‘cat > ~/dump.sql.gz’

At the end you’ll end up with a string like this,