Skip to content

Instantly share code, notes, and snippets.

View typeoneerror's full-sized avatar
🤠
iOS, Capacitor, Ember, Vue, Rails

Benjamin Borowski typeoneerror

🤠
iOS, Capacitor, Ember, Vue, Rails
View GitHub Profile
$.log = function()
{
if (window.console)
{
if (window.console.log) console.log.apply(null, arguments);
}
}
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;
}
$.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
$.isMobileSafari = function(){return navigator.userAgent.match(/AppleWebKit\/(.*)Mobile\//);}
if ($.isMobileSafari())
{
$("#facebook").hide();
$(document).bind("touchstart", function()
{
$("#facebook").hide();
});
$(window).bind("scroll", function()
alias apachegraceful="sudo /usr/sbin/apache2ctl graceful"
alias apacherestart="sudo /etc/init.d/apache2 restart"
alias apachereload="sudo /etc/init.d/apache2 reload"
<?php
//exit();
// path to web assets
define('PATH', realpath(dirname(__FILE__)));
// file to output manifest to
define('FILE_TO_WRITE', PATH . "/cache.manifest");
$.fn.startWebkitAnimation = function(name)
{
var element = $(this);
if (!element.hasClass(name))
{
element.addClass(name);
}
else
{
element.css("-webkit-animation-name", "none");
- (void)loadAchievements
{
NSLog(@"loadAchievements");
[GKAchievement loadAchievementsWithCompletionHandler:^(NSArray *achievements, NSError *error) {
if (error != nil)
{
}
if (achievements != nil)
{
NSLog(@"Achievements loaded for player: %@", achievements);
// 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];
/**
* Determines if the device running this
* application is Game Center ready.
*
* @return true if Game Center is available.
*/
BOOL isGameCenterAvailable();