About
I'm Nobu, a web developer living in Mountain View, CA. Feel free to comment on any posts. I'm also tweeting on twitter.
Archives
-
add-on amazon rds applescript cocoa css firefox gmail javascript jquery mac mamp mashup mongo mysql oauth Open Tab-History In New Tab pear php skype social SweetCatcher twitter vim
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.
-
Recent Posts
-
Blog under the Creative Commons Attribution 3.0 License
Tag Archives: php
Complete working sample for Services_Twitter OAuth in PHP PEAR
% pear install --alldeps Services_Twitter-alpha
You can get some sample codes for Services_Twitter with OAuth from php doc, but it’s not a complete code. I rewrite some parts.
<?php
if (isset($_GET['clear'])) { // sometimes you need to clear session, just access ?clear=1
session_start();
$_SESSION = array();
session_destroy();
[...]
Compiling mongo php driver on pecl for MAMP
MAMP 1.8.2 includes pecl but actually it doesn’t work. When trying to “pecl install mongo”, there will be an error.
grep: /Applications/MAMP/bin/php5/include/php/main/php.h: No such file or directory
So, I downloaded source tar ball of PHP 5.2.10 (same version as MAMP’s PHP) and configure && make && make install. Then $prefix/include directory will be created. Just copy them [...]
Load remote CSS file dynamically with jQuery
These codes are for dynamic loading for remote CSS. It’s easy to load all CSS files from the beginning or just append link element (ref. Switch stylesheets with jQuery). But it rarely needs to load a file dynamically and wait until CSS file has been loaded completely.
test.html:
<html>
<head>
<title>css.html</title>
<script src="/jquery-1.3.2.js"></script>
<script>
$(document).ready(function()
{
// if [...]
Convert multiple object to array in PHP