Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <!doctype html>
    <script src=''></script>
    <script src=''></script>
    <script src=''></script>
    <script src=""></script>
    <script src=''></script>
    <link href='//' rel='stylesheet'>
    <script data-template-name='application' type='text/x-handlebars'>
      <div class="container">
      <h4>Online Users</h4>
      {{#each user in users}}
      <br />
      <h4>Chat History ({{messages.length}})</h4>
      {{input type="text" value=new_message placeholder="Enter a message"}}
      <input type="submit" {{action publish}} />
      <br />
      <div class="well">
      {{#each message in messages}}
      window.Mini = Ember.Application.create();
      var user_id = "User " + Math.round(Math.random() * 1000);
      Mini.PubNub = PubNubEmber.extend({
        cfg: {
          subscribe_key: 'demo',
          publish_key: 'demo',
          uuid: user_id
      Mini.ApplicationController = Ember.Controller.extend({
        channel: 'The EmberJS Channel',
        new_message: '',
        user_id: user_id,
        // Ember Dynamic collection for messages list (live-updates the view)
        messages: Ember.ArrayProxy.create({ content: Ember.A(['Welcome to The EmberJS Channel']) }),
        // Ember Dynamic collection for user list (live-updates the view)
        users: Ember.ArrayProxy.create({ content: Ember.A([]) }),
        init: function() {
          var pn   = this.get('pubnub');   // PubNub service instance
          var chan = this.get('channel');  // channel name
          var self = this;                 // reference to 'this' for callbacks
          // Subscribe to the Channel
          pn.emSubscribe({ channel: chan });
          // Register for message events
          pn.on(pn.emMsgEv(chan), function(payload){
          // Register for presence events
          pn.on(pn.emPrsEv(chan), function(payload){
            self.get('users').set('content', pn.emListPresence(chan));
          // Pre-Populate the user list (optional)
          pn.emHereNow({ channel: chan });
          // Populate message history (optional)
            channel: chan,
            count: 500
        actions: {
          // set up an Ember Action to publish a message
          publish: function() {
              channel: this.get('channel'),
              message: "[" + this.get('user_id') + "] " + this.get('new_message') 
            this.set('new_message', '');