Skip to content

Instantly share code, notes, and snippets.

@ttepasse
ttepasse / open-chrome-tabs-in-safari.js
Last active October 14, 2017 21:53 — forked from paulirish/open-chrome-tabs-in-safari.scpt
open chrome tabs in safari
var chrome = Application('Google Chrome');
var safari = Application('Safari');
safari.includeStandardAdditions = true; // Needed for openLocation()
chrome.windows[0].tabs().forEach(function (tab) {
safari.openLocation( tab.url() );
// Dein fehler: '[AnyObject]?' is not a subtype of 'Void'
// dismissViewControllerAnimated will eine Closure mit der Typ-Signatur () -> Void.
// Wenn die Closure nur aus einer Expression besteht, wie hier der Aufruf von popToViewController
// dann wird der Return Value dieser Expression automagisch als Return der Closure angenommen.
// popToViewController gibt [AnyObject]? zurück. Das ist nicht Void.
// Wie fixen? So sollte es gehen.
dismissViewControllerAnimated(true, completion: {
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Akzentlos</title>
<script src="normalization_tables.js" type="text/javascript" charset="utf-8"></script>
<script src="normalization_code.js" type="text/javascript" charset="utf-8"></script>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<title>Testing inline SVG …</title>
Array.prototype.unique = function () {
var keys = {},
result = [],
items = this.length
while (items)
keys[this[--items]] = true
for (item in keys)
if (keys.hasOwnProperty(item)) result.push(item)
Array.prototype.unique = function() {
var uniqueKeys = {};
var items = this.length;
while ( items ) {
uniqueKeys[ this[ --items ] ] = true;
}
var uniqueArray = [];
for ( var key in uniqueKeys ) {
if ( uniqueKeys.hasOwnProperty( key ) ) {
Array.prototype.unique = function() {
var uniqueKeys = {};
var items = this.length;
while ( items ) {
uniqueKeys[ this[ --items ] ] = true;
}
var uniqueArray = [];
for ( var key in uniqueKeys ) {
if ( uniqueKeys.hasOwnProperty( key ) ) {
Array.prototype.unique = function() {
var uniqueKeys = {};
var items = this.length;
while ( items ) {
uniqueKeys[ this[ --items ] ] = true;
}
var uniqueArray = [];
for ( var key in uniqueKeys ) {
if ( uniqueKeys.hasOwnProperty( key ) ) {
Array.prototype.unique = function() {
var uniqueKeys = {},
uniqueArray = [],
items = this.length
while (items)
uniqueKeys[this[--items]] = true
for (var key in uniqueKeys)
if (uniqueKeys.hasOwnProperty(key)) uniqueArray.push(key)