This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
</head> | |
<body> | |
<button onclick="set(s1)">set 1</button> | |
<button onclick="set(s2)">set 2</button> | |
<button onclick="set(s3)">set 3</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
</head> | |
<body> | |
<button onclick="clear2()">clear</button> | |
<button onclick="set(s1)">set 1</button> | |
<button onclick="set(s2)">set 2</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function flatten(arr) { | |
var arr2 = []; | |
function getValue(val) { | |
if (Array.isArray(val)) { | |
val.forEach(getValue) | |
} | |
else { | |
arr2.push(val); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> db.items.find().pretty() | |
{ | |
"_id" : "undefined", | |
"_v" : "d951efc6-6869-4f08-bf6d-34b14373cabc 1461410356438|ed5b43c1-59f9-4208-8e20-1b1e4a44325a 1461780511277|b97b82c8-ad20-4e72-8eff-dee460b425e5 1461900 075779", | |
"_ops" : [ | |
{ | |
"type" : "stringSet", | |
"collectionName" : "items", | |
"docId" : "319094ef-bb35-4057-9a84-ea8eefe4f1c6", | |
"value" : [ ], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@vagrant-ubuntu-trusty-64:/data/tmp/amelisa-crud-example$ npm i | |
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible. | |
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0. | |
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible. | |
npm ERR! Linux 3.13.0-55-generic | |
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" | |
npm ERR! node v5.11.0 | |
npm ERR! npm v3.8.6 | |
npm ERR! Maximum call stack size exceeded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Add this attribute to the element that needs a tooltip */ | |
[data-tool] | |
position relative | |
z-index 2 | |
cursor pointer | |
/* Hide the tooltip content by default */ | |
[data-tool]:before, | |
[data-tool]:after | |
opacity 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET wss://my-domain.fi/channel HTTP/1.1 | |
Host: my-domain.fi | |
Connection: Upgrade | |
Pragma: no-cache | |
Cache-Control: no-cache | |
Upgrade: websocket | |
Origin: https://my-domain.fi | |
Sec-WebSocket-Version: 13 | |
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.6 Safari/537.36 | |
Accept-Encoding: gzip, deflate, sdch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream nodejs { | |
server 127.0.0.1:3000; | |
keepalive 8; | |
} | |
server { | |
listen 80; | |
listen [::]:80 ipv6only=on default_server; | |
server_name mydomain.fi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Whitelist collections | |
ALLOW_COLLECTIONS = { | |
'accounts': true | |
'users': true | |
} | |
module.exports = (shareClient) -> | |
# Hold on to session object for later use. The HTTP req object is only | |
# available in the connect event | |
shareClient.use 'connect', (shareRequest, next) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Trace: { [MongoError: E11000 duplicate key error index: myapp.auths.$local.email_1 dup key: { : "[email protected]" }] | |
name: 'MongoError', | |
connectionId: 1963, | |
err: 'E11000 duplicate key error index: myapp.auths.$local.email_1 dup key: { : "[email protected]" }', | |
code: 11000, | |
n: 0, | |
ok: 1 } | |
at /opt/derby/myapp/node_modules/share/lib/server/session.js:660:19 | |
at /opt/derby/myapp/node_modules/share/lib/server/useragent.js:409:23 | |
at /opt/derby/myapp/node_modules/livedb/lib/index.js:342:15 |