#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.
#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.
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
<?php | |
class PubSub { | |
private static $events = array(); // all subscriptions | |
// Don't allow PubSub to be initialized outside this class | |
private function __construct() {} | |
private function __clone() {} | |
/** | |
* jQuery alterClass plugin | |
* | |
* Remove element classes with wildcard matching. Optionally add classes: | |
* $( '#foo' ).alterClass( 'foo-* bar-*', 'foobar' ) | |
* | |
* Copyright (c) 2011 Pete Boere (the-echoplex.net) | |
* Free under terms of the MIT license: http://www.opensource.org/licenses/mit-license.php | |
* | |
*/ |
String.prototype.toSlug = function(){ | |
st = this.toLowerCase(); | |
st = st.replace(/[\u00C0-\u00C5]/ig,'a') | |
st = st.replace(/[\u00C8-\u00CB]/ig,'e') | |
st = st.replace(/[\u00CC-\u00CF]/ig,'i') | |
st = st.replace(/[\u00D2-\u00D6]/ig,'o') | |
st = st.replace(/[\u00D9-\u00DC]/ig,'u') | |
st = st.replace(/[\u00D1]/ig,'n') | |
st = st.replace(/[^a-z0-9 ]+/gi,'') | |
st = st.trim().replace(/ /g,'-'); |
<?php | |
/** | |
* ODBC layer for DBO | |
* Helpful for Linux connection to MS SQL Server via FreeTDS | |
* | |
* PHP 5 | |
* | |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | |
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | |
* |
<?php | |
// No controller | |
public function facebookLogin() { | |
$facebook = new Facebook(array( | |
'appId' => 'SEU ID', | |
'secret' => 'SEU SECRET', | |
)); | |
$loginUrl = $facebook->getLoginUrl(array( |
<?php | |
/** | |
* @author Gildas Quéméner <gildas@akeneo.com> | |
* @copyright 2013 Akeneo SAS (http://www.akeneo.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
use Behat\Behat\Exception\BehaviorException; | |
use Behat\Mink\Driver\Selenium2Driver; |
gunzip -c database.sql.gz | drush sqlc |