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
/** | |
Danish woven heart | |
**/ | |
.heart { | |
position: absolute; | |
left: 77px; | |
width: 3em; | |
height: 3em; | |
font-size: 16px; |
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
// If underscore is included on the page it will be added as a mixin, | |
// otherwise, it will be added to the global namespace | |
// Basic usage | |
icon('star', 'some-id-selector'); | |
// Basic underscore usage | |
_.icon('home', 'home-id-selector'); | |
// Advanced underscore usage |
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
// Google Font API | |
// --------------- | |
(function() { | |
// Font family definitions to be loaded, this should | |
// be trimmed to only the families used in production | |
WebFontConfig = { | |
google : { | |
families : [ |
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
// Viewport calculations | |
function viewport() { | |
var e = window, | |
a = 'inner'; | |
if (!('innerWidth' in window)) { | |
a = 'client'; | |
e = document.documentElement || document.body; | |
} | |
return { |
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
// iPad - iPhone detection | |
function iMobile() { | |
return ( | |
(!!~navigator.platform.indexOf("iPhone")) || | |
(!!~navigator.platform.indexOf("iPad")) | |
); | |
}; |
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
model.findOne({ name: msg.control.name }, function(err, doc) { | |
_.extend(doc, { | |
lifetime: {} | |
}) | |
Object.keys(msg.data).forEach(function(k) { | |
doc.lifetime[k] || (doc.lifetime[k] = 0) | |
doc.lifetime[k] += msg.data[k] | |
}) |
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(Room) { | |
// Dependencies | |
var Message = module("message") | |
Room.Model = Backbone.Model.extend({ | |
initialize: function() { | |
this.set({ messages: new Message.List() }) | |
} | |
}) |
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
// DNode Session | |
// ============= | |
var connect = require('connect') | |
module.exports = function(opt) { | |
var key = opt.key || 'connect.sid' | |
, store = opt.store | |
, interval = opt.interval || 120000 |
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
// http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb | |
hexToRgb = (function() { | |
var cache = {} | |
return function(hex) { | |
if (cache[hex]) return cache[hex] | |
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex) | |
return result ? cache[hex] = { | |
r: parseInt(result[1], 16) | |
, g: parseInt(result[2], 16) |
OlderNewer