Archive for the 'Things that beep and buzz' Category

How a Facebook app can change its own tab name

Saturday, August 28th, 2010

The mysterious admin.setAppProperties holds all the secrets.

How to determine who installed your Facebook app in a tab

Friday, August 27th, 2010

As any Facebook developer knows, Facebook has some restrictive ideas about permissions and what apps should be allowed to do on your behalf or even know about you. One consequence of this is that Facebook avoids giving you any information about the user who is interacting with your app in a tab. The session data you are given will contain the page’s id (known as profile_id in the decoded signed_request value) but not the user’s id. The user’s id is available when people interact with your app outside of a page tab, but that doesn’t help when it’s in a tab.
Aside: New developers, always remember that Facebook gives you more or less access to the platform depending on how the …

The evils of fb:tabs

Wednesday, August 25th, 2010

The <fb:tabs> and <fb:tab-item> FBML tags are very handy to use in your Facebook apps if you want to maintain the Facebook appearance. Unfortunately, they also have weird target behavior that causes the user to leave your application’s frame - if it’s an FBML canvas tab app, and you want to keep your app inside the tab for layout reasons, this is bad news.
To fix it, consider emulating the appearance of Facebook’s <fb:tabs> using CSS.. read on for our solution.

.fb-tabs { border-bottom: 1px solid #898989; padding: 3px 0; }
.fb-tabs .left_tabs { float: left; padding-left: 10px; }
.fb-tabs .right_tabs { float: right; padding-right: 10px; }
.fb-tabitems {
display: inline;
list-style: none;
margin: 0;
padding: 0;
text-align: center;
}
.fb-tabitems li {
display:inline;
padding: 2px 0px 3px;
background: #f1f1f1 url(http://www.facebook.com/images/components/toggle_
tab_gloss.gif) top left repeat-x;
}
.fb-tabitems li …

Incoming: Facebook App Developer tips

Wednesday, August 25th, 2010

I’m doing a lot of Facebook App development lately, and I’m finding the internet to be sorely lacking in good resources for a lot of this stuff. So on this blog in the coming weeks I’m going to feature a few tips for the greater good of the web.

Secure browser sessions by proxying through SSH

Tuesday, May 8th, 2007

Download Putty and Puttygen
Run Puttygen
Create a private key; save it somewhere on your harddrive. Don’t bother with encrypting/passwording it.
Copy the public key (shown in the box) with Ctrl-C
Login to the server you want to proxy through, as normal, with Putty
Edit .ssh/authorized_keys - you may have to create the .ssh folder
Paste your public key on one long line into the file and then log out of the server
Load your Putty settings for the site
On the left, go to Connection -> Data and enter your username where it says “Autologin Username”
On the left, go to Connection -> SSH -> Auth, and select your private key
On the left, go to Connection -> SSH -> Tunnels, type source port 1080 (or whatever you want), …

Goodbye, Digg

Tuesday, May 1st, 2007

I don’t need you selling your users to your sponsors over a few hex digits. Reddit has a better algorithm anyway.

Oh, and 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0.

FreeBSD users having trouble with pecl?

Monday, January 29th, 2007

For a while I’ve had sporadic problems with pecl (PHP’s binary module building tool, part of PEAR) not working properly. Usually the error was:
[root@host ~]# pecl install memcache

Fatal error: Call to undefined function preg_match() in /usr/local/share/pear/PEAR/Frontend/CLI.php on line 70
Yet, preg_match() would work from other scripts - it is part of pcre, which was installed.
The problem is this. pcre is included via extensions.ini. That’s why it usually works. However, pecl for some reason deliberately turns off .ini file inclusion (that includes extensions.ini) when it runs the php interpreter. I’m not sure what the objective was here but it’s a problem on FreeBSD’s shared library pcre.so.
The fix: edit the pecl script (usually /usr/local/bin/pecl) and remove the ‘-n’ from the command line arguments.

Microsoft: Developers are pawns

Tuesday, January 9th, 2007

The truth comes out - Microsoft has never cared about the developers beyond using them as leverage in the battle for the platform. If anyone is surprised by this, they’ve been asleep for the past ten years.

K notes

Tuesday, June 6th, 2006

K is a terse array-oriented programming language.

Download old, free interpreter here

Here’s an intro

My notes, so far. Note that “monadic” means the operator takes one argument (! 10); dyadic means it takes two (2 ! 10).

~ monadically is NOT.
_ is the monadic trunc operator. _ 10 = 10, _ 10.9 = 10
! is the dyadic mod operator. 100 ! 2 = 0, 101 ! 2 = 1
| (pipe) is the monadic array reverse operator. | 1 2 3 = 3 2 1
? monadically is the array uniq operator. ? 1 2 3
1 2 3
? 1 2 3 1
1 2 3

@ is the dyadic array index operator. names: `tom `bob `frank
names @ 0
`tom
names @ …

Amazing Javascript continuations library

Tuesday, May 30th, 2006

Ever wished you could do this in Javascript?

alert(”Hello!”);
sleep(30);
alert(”Done!”);

Now you can. Narrative Javascript takes your Javascript and transforms it into a gigantic switch{} statement, saving and restoring the program state as it goes so that it appears to be one function call to your program. Pretty smart.