Skip to content

Instantly share code, notes, and snippets.

@ynonp
ynonp / dabblet.css
Created February 4, 2013 08:01
Untitled
body {
font-size: 16px;
}
div {
font-size: 1.5em;
}
h1 {
font-size: 2em;
/**
* Created with JetBrains WebStorm.
* User: ynonperek
* Date: 1/28/13
* Time: 9:14 PM
*
* Mongoose plugin that adds a hashed password field
*/
var bcrypt = require('bcrypt');
// lastMod.js
module.exports = exports = function lastModifiedPlugin (schema, options) {
schema.add({ lastMod: Date })
schema.pre('save', function (next) {
this.lastMod = new Date
next()
})
if (options && options.index) {
@ynonp
ynonp / create.js
Created January 28, 2013 17:36
mongoose relationships
var mongoose = require('mongoose');
mongoose.connect('localhost/test');
var Schema = mongoose.Schema;
var AlbumSchema = new Schema({
artist: { type: Schema.Types.ObjectId, ref: 'Artist' },
name: String,
year: Number,
@ynonp
ynonp / wall.html
Created January 28, 2013 09:09
wall.html
<!DOCTYPE html>
<html>
<head>
<title>Mobile Wall</title>
<meta name="viewport" content="width=device-width"/>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
@ynonp
ynonp / picker.html
Created January 28, 2013 06:32
Color PIcker Demo
<!DOCTYPE html>
<html>
<head>
<title>Canvas Color Picker</title>
<meta name="viewport" content="width=device-width"/>
<style>
canvas {
outline: 2px solid blue;
display: block;
var e = require('express');
var app = e();
app.get('/style.css', function(r, s) {
setTimeout(function() {
s.sendfile('style.css');
}, 5000);
});
var audio = new Audio();
audio.src = 'park.mp3';
parked_btn.addEventListener('click', function() {
audio.play();
});
<!DOCTYPE html>
<html>
<head>
<title>Task Demo</title>
</head>
<body>
<form>
<label for="inp-task">Type Task Here</label>
<input type="text" id="inp-task" />
<input type="submit" value="Add" />
@ynonp
ynonp / index.html
Last active December 11, 2015 02:38
<!DOCTYPE html>
<html>
<head>
<title>Nested BB</title>
</head>
<body>
<script type="text/template" id="mbox">
<h1>{{title}}</h1>
<div id="messagesView">