Sunday, June 03, 2012

Using Facebook Graph API with NimbleKit

YOU MUST configure your application according to the SSO process defined in the Facebook iOS SDK, including, selecting the proper authentication methods:

* Native/Desktop
* Native iOS App
* iOS Bundle ID
* iPhone App Store ID
* Configured for iOS SSO (Enabled)
* iOS Native Deep Linking (Enabled)

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// MyAppDelegate.h
///////////////////////////////////////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// MyAppDelegate.m
///////////////////////////////////////////////////////////////////////////////////////////////////////////////



///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// main.html
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

<html>
<head>
<meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="NKit.js"></script>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<link charset="utf-8" href="main.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript">
//disable touch scrolling
document.ontouchmove = function(event){event.preventDefault();}
var message;
NKRegisterClass("MyAppDelegate");
</script>
</head>
<body>
<a href="#" id="fb">Post to Facebook</a>
<script type="text/javascript">
$("a#fb").click(function(evt){
evt.preventDefault();
message = "I can post from NimbleKit to my Facebook News Feed!";
CallNKitAction("fbPost?className=MyAppDelegate");
});
</script>
</body>
</html>

Tuesday, May 08, 2012

MySQL LOAD DATA LOCAL INFILE UTF8 WTF

It appears that using LOAD DATA LOCAL INFILE to populate a remote server using the --local-infile ignores the server's character set, and ONLY recognizes the database or sessions. Unfortunately, rebuilding the schema and specifying a default character set, quickly, was out of the question. The solution (that I found, there could always be others) -- was setting the MySQL session settings, "collation_database" and "character_set_database."

Example of LOAD DATA LOCAL INFILE (supporting different MySQL database charsets):

mysql --default-character-set=utf8 -h database_host -uuser -p --local-infile=1 -e "set session collation_database=utf8_general_ci; set session character_set_database=utf8; LOAD DATA LOCAL INFILE '/tmp/source.txt' INTO TABLE table_name (column, column, ....)" database_name

Wednesday, April 18, 2012

Add timestamp to Rails BufferedLogger output

Little monkey-patch to automatically add a timestamp next to each BufferedLogger log entry. Throw it in your Rails "initializers" directory as "make_buffered_logger_useful.rb" ;)

Friday, March 02, 2012

iFilmFanatic movie trivia game

Just released iFilmFanatic - a movie quote trivia game for iOS.

ifilmfanatic.com
http://itunes.apple.com/app/id505386256?mt=8