This file contains hidden or 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> | |
<title>Canvas Color Picker</title> | |
<meta name="viewport" content="width=device-width"/> | |
<style> | |
canvas { | |
outline: 2px solid blue; | |
display: block; |
This file contains hidden or 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> | |
<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> |
This file contains hidden or 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
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, |
This file contains hidden or 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
// 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) { |
This file contains hidden or 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
/** | |
* 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'); |
This file contains hidden or 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
body { | |
font-size: 16px; | |
} | |
div { | |
font-size: 1.5em; | |
} | |
h1 { | |
font-size: 2em; |
This file contains hidden or 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> | |
<title>Image Gallery</title> | |
<style> | |
#gallery { | |
list-style: none; | |
} | |
#gallery img { | |
width: 200px; |
This file contains hidden or 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
.autocomplete { | |
list-style: none; | |
position: absolute; | |
top: 0; | |
left: 0; | |
padding: 0; | |
margin: 0; | |
outline: 1px solid gray; | |
display: none; | |
} |
This file contains hidden or 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
#nav { | |
list-style: none; | |
padding: 0; margin: 0; | |
display: none; | |
} | |
li { | |
display: inline-block; | |
padding: 10px; | |
background: #777; |
This file contains hidden or 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
use strict; | |
use warnings; | |
use v5.14; | |
use List::Util qw/sum/; | |
use Data::Dumper; | |
sub diff_sum { | |
my ( $l_ref, $g_ref ) = @_; | |
return sum(@$l_ref) - sum(@$g_ref); | |
} |