#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
$countries = Zend_Locale::getTranslationList('territory'); | |
asort($countries); | |
$options = array(); | |
foreach ($countries as $short => $translation) { | |
if (strlen($short) == 2) { | |
$options[] = [ | |
'key' => $translation, | |
'value' => $short | |
]; |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
/** | |
* when helper | |
* | |
* {{#when foo bar}} | |
* eat this | |
* {{/when}} | |
*/ | |
Handlebars.registerHelper('when', function (a, b, options) { | |
if(String(a).toLowerCase() == String(b).toLowerCase()){ |
public static function distance($lat1, $lon1, $lat2, $lon2) | |
{ | |
$theta = $lon1 - $lon2; | |
$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); | |
$dist = acos($dist); | |
$dist = rad2deg($dist); | |
$kilometers = $dist * 60 * 1.8531596160; | |
return $kilometers; | |
} |
#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
$bpLarge:1200; | |
$bpDesktop:960; | |
$bpTablet:768; | |
@mixin breakPoint($name) { | |
@if $name == large { | |
@media (min-width: #{$bpLarge}px) { | |
@content; | |
} |
; | |
(function ($, window, document, undefined) { | |
'use strict'; | |
var pluginName = 'plugin', | |
defaults = { | |
propertyName: "value" | |
}; | |
<?php | |
/** | |
* Class WebsiteSettings | |
*/ | |
class WebsiteSettings extends Zend_Db_Table_Abstract | |
{ | |
protected $_name = 'website_settings'; | |
protected $_primary = 'id'; | |
} |
MyView = Backbone.View.extend({ | |
options:{}, | |
className: '', | |
events: { | |
}, | |
initialize: function (options) { | |
if(options){ | |
_.extend(this.options, options); |
App.utils = { | |
mobile:{ | |
isAndroid: function() { | |
return navigator.userAgent.match(/Android/i); | |
}, | |
isBlackBerry: function() { | |
return navigator.userAgent.match(/BlackBerry/i); | |
}, | |
isIos: function() { | |
return navigator.userAgent.match(/iPhone|iPad|iPod/i); |