#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.
| <?php | |
| /** | |
| * This is free and unencumbered software released into the public domain. | |
| * | |
| * Anyone is free to copy, modify, publish, use, compile, sell, or | |
| * distribute this software, either in source code form or as a compiled | |
| * binary, for any purpose, commercial or non-commercial, and by any | |
| * means. | |
| * |
#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.
| #go to the folder | |
| cd /Applications/MAMP/bin | |
| #get drush off on the internet (mac has curl not wget, make sure it is the latest drush) | |
| curl -O http://ftp.drupal.org/files/projects/drush-7.x-4.5.tar.gz | |
| #decompress | |
| tar -zxvf drush-7.x-4.5.tar.gz | |
| #delete tar ball | |
| rm drush-7.x-4.5.tar.gz | |
| #user executable | |
| chmod u+x drush/drush |
| <?php | |
| /* | |
| * Resize images dynamically using wp built in functions | |
| * Victor Teixeira | |
| * | |
| * php 5.2+ | |
| * | |
| * Exemplo de uso: | |
| * | |
| * <?php |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
| <script src="jquery.ketchup.all.min.js" type="text/javascript"></script> | |
| </head> | |
| <body> | |
| <div id="email"> | |
| <span>Enter your email to sign up</span> | |
| <form action="/subscribe.php" id="invite" method="POST"> |
| /* if portrait mode is detected, rotate the entire site -90 degrees to hint rotating to landscape */ | |
| @media (orientation: portrait) { | |
| body { | |
| -webkit-transform: rotate(-90deg); | |
| -moz-transform: rotate(-90deg); | |
| -o-transform: rotate(-90deg); | |
| -ms-transform: rotate(-90deg); | |
| transform: rotate(-90deg); | |
| } | |
| } |
| // set-up a connection between the client and the server | |
| var socket = io.connect(); | |
| // let's assume that the client page, once rendered, knows what room it wants to join | |
| var room = "abc123"; | |
| socket.on('connect', function() { | |
| // Connected, let's sign-up for to receive messages for this room | |
| socket.emit('room', room); | |
| }); |
| <?php | |
| /** | |
| * I had to parse an XLSX spreadsheet (which should damn well have been a CSV!) | |
| * but the usual tools were hitting the memory limit pretty quick. I found that | |
| * manually parsing the XML worked pretty well. Note that this, most likely, | |
| * won't work if cells contain anything more than text or a number (so formulas, | |
| * graphs, etc ..., I don't know what'd happen). | |
| */ |
| $(document).ready(function () { | |
| loaddatepicker(); | |
| }); | |
| $(document).ajaxComplete(function () { | |
| loaddatepicker(); | |
| }); | |
| function loaddatepicker() { |
| <?php | |
| /** | |
| * Split PDF file | |
| * | |
| * <p>Split all of the pages from a larger PDF files into | |
| * single-page PDF files.</p> | |
| * | |
| * @package FPDF required http://www.fpdf.org/ | |
| * @package FPDI required http://www.setasign.de/products/pdf-php-solutions/fpdi/ |