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
<select name="color" id="form-color"> | |
<option value="#F0F8FF">AliceBlue</option> | |
<option value="#FAEBD7">AntiqueWhite | |
<option value="#00FFFF">Aqua</option> | |
<option value="#7FFFD4">Aquamarine</option> | |
<option value="#F0FFFF">Azure</option> | |
<option value="#F5F5DC">Beige</option> | |
<option value="#FFE4C4">Bisque</option> | |
<option value="#000000" selected>Black</option> | |
<option value="#FFEBCD">BlanchedAlmond</option> |
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
lsof -n -i4TCP:$PORT | grep LISTEN |
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
/** | |
* Main.js | |
* https://github.com/anselmh/wdrl/blob/gh-pages/js/main.js | |
* | |
*/ | |
(function (global) { | |
'use strict'; | |
// Twitter 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
<?php | |
class Plugin_contains extends Plugin { | |
public function index() { | |
$needle = $this->fetchParam('needle', '', null, false, false); | |
$haystack = $this->context[$this->fetch('haystack')]; | |
return strpos($haystack, $needle) ? $this->content : false; |
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
grunt.task.registerTask('copy-deps', 'Copy npm dependencies', function () { | |
var done = this.async(); | |
var deps = Object.keys(pkg.dependencies); | |
var path = require('path'); | |
var fs = require('fs'); | |
if ( deps.length ) { | |
deps.forEach((dep) => { |
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.exports = function(grunt) { | |
require('time-grunt')(grunt); | |
require('load-grunt-tasks')(grunt); | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
copy: { | |
dist: { | |
files: [{ | |
expand: true, |
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
"use strict"; | |
// Get all the elements with epub:type | |
// Since querySelectorAll can’t be used with XHTML attributes, | |
// we create an array in which we’ll push elements with an epub:type attribute | |
// Mappings table (epub → role) | |
var mappings = { | |
"abstract":"doc-abstract", | |
"acknowledgments":"doc-acknowledgments", |
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 the length of the longest classname in document | |
[].slice.call(document.querySelectorAll('body *')).filter(el => el.nodeType === 1 && typeof el.className === 'string').reduce( (m, el) => { | |
const l = el.className.split(' ').filter(classname => classname.length > m).sort((a,b) => a.length - b.length).shift(); | |
return l ? l.length : m; | |
},0) | |
// get the longest classname | |
[].slice.call(document.querySelectorAll('body *')).filter(el => el.nodeType === 1 && typeof el.className === 'string').reduce( (m, el) => { |