Please see: https://github.com/kevinSuttle/html-meta-tags, thanks for the idea @dandv!
Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/
| // app-style.js | |
| // adding <style></style> directly inside template will result in error or empty element which | |
| // this component is trying to address | |
| // this will allow you to dynamically insert css inside Vue template without the use of vue loader | |
| // or if you do not want to use .vue extension at all | |
| // however it doesnt really apply scope css (for now). | |
| export default { | |
| name: 'app-style', | |
| data: function(){ | |
| return { |
| // sending to sender-client only | |
| socket.emit('message', "this is a test"); | |
| // sending to all clients, include sender | |
| io.emit('message', "this is a test"); | |
| // sending to all clients except sender | |
| socket.broadcast.emit('message', "this is a test"); | |
| // sending to all clients in 'game' room(channel) except sender |
| function xpath(el) { | |
| if (typeof el == "string") return document.evaluate(el, document, null, 0, null) | |
| if (!el || el.nodeType != 1) return '' | |
| if (el.id) return "//*[@id='" + el.id + "']" | |
| var sames = [].filter.call(el.parentNode.children, function (x) { return x.tagName == el.tagName }) | |
| return xpath(el.parentNode) + '/' + el.tagName.toLowerCase() + (sames.length > 1 ? '['+([].indexOf.call(sames, el)+1)+']' : '') | |
| } | |
| // Usage: |
| /* ~/Library/KeyBindings/DefaultKeyBinding.Dict | |
| This file remaps the key bindings of a single user on Mac OS X 10.5 to more | |
| closely match default behavior on Windows systems. This makes the Command key | |
| behave like Windows Control key. To use Control instead of Command, either swap | |
| Control and Command in Apple->System Preferences->Keyboard->Modifier Keys... | |
| or replace @ with ^ in this file. | |
| Here is a rough cheatsheet for syntax. | |
| Key Modifiers |
| [ | |
| { | |
| "state":"Alaska", | |
| "latitude":61.3850, | |
| "longitude":-152.2683 | |
| }, | |
| { | |
| "state":"Alabama", | |
| "latitude":32.7990, | |
| "longitude":-86.8073 |
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>collab editing, yo</title> | |
| <link rel="stylesheet" href="http://codemirror.net/lib/codemirror.css"> | |
| <link rel="stylesheet" href="http://codemirror.net/theme/ambiance.css"> | |
| <script src="http://codemirror.net/lib/codemirror.js"></script> | |
| <script src="http://codemirror.net/addon/mode/overlay.js"></script> | |
| <script src="http://codemirror.net/mode/xml/xml.js"></script> |
| // set-up a connection between the client and the server | |
| var socket = io.connect(); | |
| // let's assume that the client page, once rendered, knows what room it wants to join | |
| var room = "abc123"; | |
| socket.on('connect', function() { | |
| // Connected, let's sign-up for to receive messages for this room | |
| socket.emit('room', room); | |
| }); |
| function slugify(text) | |
| { | |
| return text.toString().toLowerCase() | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
| .replace(/\-\-+/g, '-') // Replace multiple - with single - | |
| .replace(/^-+/, '') // Trim - from start of text | |
| .replace(/-+$/, ''); // Trim - from end of text | |
| } |