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"> | |
<title>Color picker · CodePen</title> | |
<style> |
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
/** | |
* jQuery.support.cssProperty | |
* To verify that a CSS property is supported (or any of its browser-specific implementations) | |
* | |
* @param string p - css property name | |
* [@param] bool rp - optional, if set to true, the css property name will be returned, instead of a boolean support indicator | |
* | |
* @Author: Axel Jack Fuchs (Cologne, Germany) | |
* @Date: 08-29-2010 18:43 | |
* |
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
Handlebars.registerHelper('if_task_active', function(options) { | |
var state = this.model.state_id; | |
if (state == 300) { | |
return options.fn(this); | |
} | |
return options.inverse(this); | |
}); |
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
/** | |
* Serializing object function | |
*/ | |
$.fn.serializeObject = function() | |
{ | |
var object = {}; | |
var array = this.serializeArray(); | |
$.each(array, function() { | |
if (object[this.name] !== undefined) { |
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
/*------------------------------------*\ | |
$NAV | |
\*------------------------------------*/ | |
/* | |
TAGS: ^lists ^navigation ^text | |
*/ | |
/* | |
As per csswizardry.com/2011/09/the-nav-abstraction | |
*/ | |
.nav{ |
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
/** | |
* Fallback for "Placeholder" attribute in old browsers | |
* source: http://www.scriptiny.com/2012/08/html5-placeholder-fallback-using-jquery/?utm_source=html5weekly&utm_medium=email | |
*/ | |
$(document).ready(function() { | |
if (!('placeholder' in document.createElement('input'))) { | |
$('input[placeholder]').each(function() { | |
var val = $(this).attr('placeholder'); |
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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
// Usage: | |
// express_app.register('html', htmlRenderer({stripNewlines: true})); | |
// ... | |
// express_app.get('/plain', function(req, res){ | |
// res.render('./path_to_html_file'); | |
// }) | |
function htmlRenderer(opt){ | |
var stripNewlines = opt && opt.stripNewlines; | |
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
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
, routes = require('./routes') | |
, http = require('http') | |
, path = require('path') | |
// ! | |
, swig = require('./config/consolidate-swig').swig |
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 randomize() { | |
var letters = '0123456789ABCDEF'.split(''); | |
var color = '#'; | |
for (i = 0; i < 6; i++) { | |
color += letters[Math.round(Math.random() * 15)]; | |
} | |
return color | |
} |
OlderNewer