24 May 2013 0 Comments
Cool stuff my colleagues do

At work I’m surrounded by creative and talented souls. Just wanted to share some of my colleagues’ cool private work, which sometimes make me question what I’m doing with my spare time.

Res i STHLM

image

Undoubtedly the most popular iOS app for planing your trip with SL. Eric Nilsson is a great iOS programmer and it’s a shame we haven’t seen more public work from Yeah Softwares. He (and I) are also involved in the making of the Sveriges Radio Play app.

Download in App Store

Ripple Dot Zero

image

Tommy Salomonsson is one of our more senior flash developers. Many years ago he started a game project inspired by the 90′s 16-bit platformers. Now the time has come for launch.

Play in browser (soon)

Tire

Tire is a lightweight, jQuery-inspired JavaScript library for modern browser. Built and maintained by our young and promising newcomer Fredrik Forssmo. I haven’t tried the library, but I’ve seen Fredrik code. It must be good!

Download or fork at Github

Almas 123

Nils Wikberg is one of those guys who wants to get in on everything. He’s probably tried more frameworks than you’ve changed underwear. This project he made on his paternal leave, in his jelaousy of us at the office doing ‘real work’.

Download in App Store

I bet there exists many more I haven’t heard of yet. My colleagues aren’t only creative – they’re also prestigeless and modest.

19 April 2013 0 Comments
The ultimate MAMP setup

Thank you Edward Mann for the tip. Saving this great setup for future use. Now I can take advantage of automatic updates with ‘brew upgrade’. I skipped some parts like the dnsmasq which I find a bit too complicated. /etc/hosts serves just fine.

Install php and mysql using brew

$ brew tap josegonzalez/homebrew-php
$ brew install php54
$ brew install mysql
$ sudo mkdir /var/mysql
$ sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

By doing this you don’t have to create new virtual host settings for new sites. The url you enter will be automatically mapped to the folder with the same name on your disk.

/etc/apache2/users/your-username.conf

<Directory '/Users/your-username/Sites/'>
  Options Indexes MultiViews FollowSymLinks Includes
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>
 
<VirtualHost *:80>
  UseCanonicalName off
  VirtualDocumentRoot /Users/your-username/Sites/%1
</VirtualHost>

Start Apache and MySQL

$ sudo apachectl restart
$ mysql.server start
17 April 2013 0 Comments
Preventing child pages in EPiServer from inheriting categories

When a customer requested to remove this behaviour I wasn’t aware it’s actually default in EPiServer. Whether it makes sense or not “”– it’s easy to get rid off.

// Listen to the event that occurs when an empty page is loaded
// through GetPageDefaultPageData() e.g. when creating a page
DataFactory.Instance.LoadedDefaultPageData += Instance_LoadedDefaultPageData;
 
static void Instance_LoadedDefaultPageData(object sender, PageEventArgs e)
{
    // Clear the page's categories
    e.Page.Category.Clear();
}
15 April 2013 0 Comments

Need testing for your app? A friend of mine just started this project and I think it’s a great idea!

8 March 2013 0 Comments
Googly - a Gmail checker for OSX

Do you like the standard gmail web interface but need a clean way of getting notified when new mails arrive? Googly is a menu bar app for OSX Mountain Lion which checks your Gmail accounts at regular intervals.

I built Googly with simplicity in mind. It integrates nicely into the OSX notification center, so that for example notifications are disabled when in presentation mode. Later, you can just open the notification sidebar and click on each mail you’ve missed individually to open it in your default browser.

Except for navigation through the notification sidebar you can also click on the menu bar icon and see the unread mail count per account and open each account individually. It works with multiple accounts and hosted as not hosted accounts.

That’s what there is to it. So far. The app has only been tested in OSX Mountain Lion and only by a few people, so please be tolerant to bugs you may find and report them here or mail me directly.

Download Googly 1.0

14 February 2013 0 Comments
Can’t search users in EPiServer with ActiveDirectoryMembershipProvider

When EPiServer calls the membership provider’s FindUsersByName/FindUsersByEmail it adds % around the string to enable wildcard searching in SQL. Unfortunately, Active Directory does not use % for wildcard, but an asterisk  (*). Maybe this is something EPiServer should fix? For now, there’s a pretty easy fix - override the above methods in your own inherited class and string replace % with *.


public class MyActiveDirectoryMembershipProvider : System.Web.Security.ActiveDirectoryMembershipProvider
{
  public override System.Web.Security.MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
  {
    return base.FindUsersByName(usernameToMatch.Replace("%", "*"), pageIndex, pageSize, out totalRecords);
  }

  public override System.Web.Security.MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
  {
    return base.FindUsersByEmail(emailToMatch.Replace("%", "*"), pageIndex, pageSize, out totalRecords);
  }
}

Remember to change provider in web.config!

21 December 2012 0 Comments
Quick tips on developing Cocoa apps

Fire event after computer has awaken from sleep


// Become observe of the did wake notification
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(receivedWakeNote:) name:NSWorkspaceDidWakeNotification object:nil];

- (void)receivedWakeNote: (NSNotification *)notification {
  // Code here
}

Send a notification to the notification center in OSX Mountain Lion


  NSUserNotification *notification = [[NSUserNotification alloc] init];
  notification.title = @"Notification";
  notification.subtitle = @"Hello world";
  notification.soundName = NSUserNotificationDefaultSoundName;

  [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

Create that nice looking sliding down window used in the Twitter app amongst many

The sliding window is actually called a sheet. Here’s an example for when you have two windows within the same view controller:


// Activate the sheet
[NSApp beginSheet:_windowToSlideDown modalForWindow:self.window modalDelegate:self didEndSelector:nil contextInfo:nil];

// Close the sheet
[NSApp endSheet:self.accountDetailsSheet];
[self.accountDetailsSheet close];
13 October 2012 0 Comments
Irssi log reader with PHP

I realize this is pretty specific, but hey, I’m not in this for the money. Ever wanted to check what’s been happening on your screen:ed ssh irssi session without having to login and reattach, like through a web page? Then you’ve come to the right place - here’s a simple php script to do exactly that. Now you can sit back, relax and spy on your friends using your iphone or whatever!


<?php

// Absolut path to irssi log files
$log_dir = "/home/kim/.irssi/logs/localhost";
// Regex for log files to exclude
$exclude_channels = "auth.log|q.log|_status.log";
// Number of channels to include in the report
$number_of_channels = 10;
// Number of lines per channels to include
$number_of_lines = 10;

$lines = shell_exec('
  ls `find '.$log_dir.' -type f -print` --sort=t |
  egrep -v "'.$exclude_channels.'" |
  head -n'.$number_of_channels.' |
  xargs tail -n'.$number_of_lines);

echo "<pre>$lines</pre>";

?>

Tip: You can include multiple log dirs, just separate the paths in $log_dir by a space.

13 October 2012 0 Comments
My OSX Terminal, Irssi and Vim setup

Vim

Let’s start off with vim. First of all, Vim is useless to me without the power pack Janus. On top of this, I’ve added the fancy Powerline from Lokaltag, and some nice colors from Hybrid by w0ng. If I only knew some good way to work with .NET-development through VIM, I probably would have uninstalled all other text editors by now.

Irssi

Yes, and then there’s Irssi. I really just have one word for you here - Pbrisbin. I’ve made a couple of tweaks to it, but nothing important really. Here’s a list of all the plugins I use: adv_windowlist.pl, bitlbee_typing_notice.pl, hide.pl, link_titles.pl, nm.pl,  trackbar.plbitlbee_tab_completion.pl, facebook_bitlbee_rename.pl, hilightwin.pl  nicklist.pl, queryresume.pl, usercount.pl. I think most of these can be found at Irssi scripts.

OSX Terminal

Nothing of the above will look right without the right terminal settings. w0ng has instructions on the hybrid theme page above on how to setup the colors for X11. I followed those instructions, plus some extra tweaks to get the terminal look right in OSX. Or even better, in my opinion (everything looks better in OSX ;)). Here’s the Terminal theme if you’re feeling lazy. The font I use is Liberation Mono 11 pt. Yes, and all should work through SSH, since the screens above are actually taken using SSH to a Linux machine.

28 September 2012 0 Comments
Some new app findings for Mac

Maybe nothing new to the mac enthusiast, but here goes..

Transmit

image

Before last post I spent some time exploring the options for mounting ssh drives through CLI. This time I went nuts and bought what seemed to be the best GUI alternative - Transmit. Although I haven’t even tried the built-in remote site explorer yet, I can safely say it was worth the money considering how often I need to mount various remote drives to my local machine. App Store or http://panic.com/transmit/

Textual IRC Client

Still an IRC junkie like me? Sure, I still don’t know any more talented irc client than irssi. But terminal has its drawbacks, and sometimes it’s nice to lay eyes on something more easing for the eyes. Textual is really the sleekest GUI alternative I found after a 10 minutes research! App Store or http://codeux.com/textual/