Skip to content

Instantly share code, notes, and snippets.

@ChrisBuchholz
Created October 13, 2014 17:45
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisBuchholz/b29f40f3a1c5788d3f1c to your computer and use it in GitHub Desktop.
Save ChrisBuchholz/b29f40f3a1c5788d3f1c to your computer and use it in GitHub Desktop.
New XCode Playground
TIMESTAMP=`date +%s`
PLAYGROUNDDIR=~/Playgrounds/
NEW=$TIMESTAMP.playground
PLAYGROUND=$PLAYGROUNDDIR$NEW
mkdir -p $PLAYGROUND
cat > $PLAYGROUND/section-1.swift <<EOF
// Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
EOF
cat > $PLAYGROUND/contents.xcplayground <<EOF
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='1.0' sdk='iphonesimulator'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
</playground>
EOF
touch $PLAYGROUND/Results.playgrounddata
open $PLAYGROUND
TIMESTAMP=`date +%s`
PLAYGROUNDDIR=~/Playgrounds/
NEW=$TIMESTAMP.playground
PLAYGROUND=$PLAYGROUNDDIR$NEW
mkdir -p $PLAYGROUND
cat > $PLAYGROUND/section-1.swift <<EOF
// Playground - noun: a place where people can play
import Cocoa
var str = "Hello, playground"
EOF
cat > $PLAYGROUND/contents.xcplayground <<EOF
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='1.0' sdk='macosx'>
<sections>
<code source-file-name='section-1.swift'/>
</sections>
</playground>
EOF
touch $PLAYGROUND/Results.playgrounddata
open $PLAYGROUND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment