This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.log = function() | |
{ | |
if (window.console) | |
{ | |
if (window.console.log) console.log.apply(null, arguments); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function videoIdFromGoogleUrl($source) | |
{ | |
$pattern = "/^(?:http:\/\/video.google.com\/(?:videoplay|googleplayer.swf)\?docid=([\w\-]+))/is"; | |
$matches = array(); | |
preg_match($pattern, $source, $matches); | |
if (isset($matches[1])) return $matches[1]; | |
return $source; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.isMobileSafari = function(){return navigator.userAgent.match(/AppleWebKit\/(.*)Mobile\//);} | |
if ($.isMobileSafari()) | |
{ | |
$("#facebook").css("position", "absolute"); | |
$.bindToBottom = function() | |
{ | |
$("#facebook").css("top", (window.pageYOffset + window.innerHeight - 30) + 'px'); | |
} | |
// sadly this does nothing as the pageYOffset is set |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.isMobileSafari = function(){return navigator.userAgent.match(/AppleWebKit\/(.*)Mobile\//);} | |
if ($.isMobileSafari()) | |
{ | |
$("#facebook").hide(); | |
$(document).bind("touchstart", function() | |
{ | |
$("#facebook").hide(); | |
}); | |
$(window).bind("scroll", function() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias apachegraceful="sudo /usr/sbin/apache2ctl graceful" | |
alias apacherestart="sudo /etc/init.d/apache2 restart" | |
alias apachereload="sudo /etc/init.d/apache2 reload" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//exit(); | |
// path to web assets | |
define('PATH', realpath(dirname(__FILE__))); | |
// file to output manifest to | |
define('FILE_TO_WRITE', PATH . "/cache.manifest"); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.startWebkitAnimation = function(name) | |
{ | |
var element = $(this); | |
if (!element.hasClass(name)) | |
{ | |
element.addClass(name); | |
} | |
else | |
{ | |
element.css("-webkit-animation-name", "none"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)loadAchievements | |
{ | |
NSLog(@"loadAchievements"); | |
[GKAchievement loadAchievementsWithCompletionHandler:^(NSArray *achievements, NSError *error) { | |
if (error != nil) | |
{ | |
} | |
if (achievements != nil) | |
{ | |
NSLog(@"Achievements loaded for player: %@", achievements); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get current achievement from array as a description | |
GKAchievementDescription *achievement = (GKAchievementDescription *)[self.achievementsList objectAtIndex:row]; | |
// set the cell's text to the title | |
cell.textLabel.text = achievement.title; | |
// check to see if achievement has been completed | |
if ([self.achievements objectForKey:achievement.identifier]) | |
{ | |
// get the achievement from the dictionary using the identifier | |
GKAchievement *theAchievement = [self.achievements objectForKey:achievement.identifier]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Determines if the device running this | |
* application is Game Center ready. | |
* | |
* @return true if Game Center is available. | |
*/ | |
BOOL isGameCenterAvailable(); | |
OlderNewer