#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.
<!doctype html> | |
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ --> | |
<html> | |
<head> | |
<title>iOS 8 web app</title> | |
<!-- CONFIGURATION --> |
#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.
# strip out iBooks citation | |
sed -E -e 's/^[ ]?[0-9]* //g' | sed -E -e 's/“[ ]?[0-9]?[ ]?//g' | sed -E -e 's/”$//g' | sed -E -e 's/^(Excerpt From).*//g' |
# There are 3 levels of git config; project, global and system. | |
# project: Project configs are only available for the current project and stored in .git/config in the project's directory. | |
# global: Global configs are available for all projects for the current user and stored in ~/.gitconfig. | |
# system: System configs are available for all the users/projects and stored in /etc/gitconfig. | |
# Create a project specific config, you have to execute this under the project's directory. | |
$ git config user.name "John Doe" | |
# Create a global config |
<!DOCTYPE html> | |
<head> | |
<title>Stay Standalone</title> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
<script src="stay_standalone.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<ul> | |
<li><a href="http://google.com/">Remote Link (Google)</a></li> |
# | |
# Slightly tighter CORS config for nginx | |
# | |
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
# | |
# Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
# don't seem to play nicely with this. | |
# |
BridgeTalk.prototype.sendSynch = function(timeout) { | |
var self = this; | |
self.onResult = function(res) { | |
this.result = res.body; | |
this.complete = true; | |
} | |
self.complete = false; | |
self.send(); | |
if (timeout) { |
// Import SVG Files as Layers - Illustrator CS3 script | |
// Description: Imports a folder of SVG files as named layers into a new document | |
// Author: Robert Moggach (rob@moggach.com) | |
// Version: 0.0.1 on 2014-05-29 | |
function getFolder() { | |
return Folder.selectDialog('Please select the folder to be imported:', Folder('~')); | |
} |
var doc = app.activeDocument; | |
var docPath = doc.path; | |
function loadUrl(url, callback) { | |
var bt = new BridgeTalk(); | |
bt.target = 'bridge' ; |
class LimitedAdminInlineMixin(object): | |
""" | |
InlineAdmin mixin limiting the selection of related items according to | |
criteria which can depend on the current parent object being edited. | |
A typical use case would be selecting a subset of related items from | |
other inlines, ie. images, to have some relation to other inlines. | |
Use as follows:: |