#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.
| // Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/ | |
| var metas = document.getElementsByTagName('meta'); | |
| var i; | |
| if (navigator.userAgent.match(/iPhone/i)) { | |
| for (i=0; i<metas.length; i++) { | |
| if (metas[i].name == "viewport") { | |
| metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; | |
| } | |
| } |
#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.
Read Damon Muma on this. He proposes the following jQuery solution (inspired by Thompson, fixed by me):
// Apply focus properly when accessing internal links with keyboard in WebKit browsers.
$("a[href^='#']").not("a[href='#']").click(function() {
$("#"+$(this).attr("href").slice(1)+"").focus();
});| type JSONContainer struct { | |
| data []interface{} | |
| } | |
| func (j *JSONContainer) All() (objects []JSONObject) { | |
| for _, v := range j.data { | |
| objects = append(objects, JSONObject{data: v}) | |
| } | |
| return | |
| } |
| // | |
| // CustomCollectionFlowLayout.h | |
| // evilapples | |
| // | |
| // http://stackoverflow.com/questions/13511733/how-to-make-supplementary-view-float-in-uicollectionview-as-section-headers-do-i | |
| // | |
| // | |
| #import <UIKit/UIKit.h> |
with different environments like staging and production no less! new: now with multiple account administration!
npm in package.json.process.env.STRONGLOOP_PORT || [your usual local port].git.➽ If you need to handle multiple accounts, install the accounts plugin.
| { | |
| "name": "load-google-maps", | |
| "version": "1.0.0", | |
| "main": ["./load-google-maps.js"], | |
| "author": "Glenn Baker & Gavin Foley", | |
| "dependencies": { | |
| "jquery": ">=1.5" | |
| }, | |
| "license": ["MIT", "GPL"], | |
| "keywords": ["Google Maps", "Async"] |
| for (var i = 0; i < array.length; i++) (function (i, arrayElement) { | |
| // this will create a new variables i and arrayElement for each loop iteration | |
| // so we can use it in an async callback | |
| doSomeAsync(function callback () { | |
| console.log(i, arrayElement); | |
| }); | |
| }) (i, array[i]); |
| // ---- | |
| // Sass (v3.3.8) | |
| // Compass (v1.0.0.alpha.19) | |
| // ---- | |
| // Hacking made easy | |
| // --- | |
| // A couple of Sass functions | |
| // To ease the pain of dealing | |
| // With special values for IE |
| // Bootstrap Mid-Small - col-ms-* - the missing grid set for Bootstrap3. | |
| // | |
| // This is a hack to fill the gap between 480 and 767 pixels - a missing range | |
| // in the bootstrap responsive grid structure. Use these classes to style pages | |
| // on cellphones when they transition from portrait to landscape. | |
| // | |
| // Contains: | |
| // Columns, Offsets, Pushes, Pulls for the Mid-Small layout | |
| // Visibility classes for the Mid-Small layout | |
| // Redefined visibility classes for the Extra Small layout |