Demo of multipart form/file uploading with hapi.js
.
npm install
npm run setup
npm run server
Then ...
$(function() { | |
var converter = new Showdown.converter(); | |
$("#user_input").keyup(function(){ | |
var txt = $("#user_input").val(); | |
var html = converter.makeHtml(txt); | |
$("#result").html(html) | |
$("#html_result").val(html.replace(/>/g, ">\n").replace(/</g, "\n<").replace(/\n{2,}/g, "\n\n")); | |
}); | |
var sample = "#### Underscores\nthis should have _emphasis_\nthis_should_not\n_nor_should_this\n\n\ |
/* | |
* Minimal classList shim for IE 9 | |
* By Devon Govett | |
* MIT LICENSE | |
*/ | |
if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') { | |
Object.defineProperty(HTMLElement.prototype, 'classList', { | |
get: function() { |
/************************************************************************** | |
* OSM2GEO - OSM to GeoJSON converter | |
* OSM to GeoJSON converter takes in a .osm XML file as input and produces | |
* corresponding GeoJSON object. | |
* | |
* AUTHOR: P.Arunmozhi <[email protected]> | |
* DATE : 26 / Nov / 2011 | |
* LICENSE : WTFPL - Do What The Fuck You Want To Public License | |
* LICENSE URL: http://sam.zoy.org/wtfpl/ | |
* |
// Maintain ratio mixin. Great for responsive grids, or videos. | |
// https://gist.github.com/brianmcallister/2932463 | |
// | |
// $ratio - Ratio the element needs to maintain. | |
// | |
// Examples | |
// | |
// // A 16:9 ratio would look like this: | |
// .element { | |
// @include maintain-ratio(16 9); |
/* | |
* From css-tricks.com | |
* http://css-tricks.com/snippets/css/media-queries-for-standard-devices/ | |
*/ | |
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Styles */ |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Holy Grail</title> | |
<style> | |
/* some basic styles. nothing to do with flexbox */ | |
header, footer, | |
nav, article, aside { | |
border: 1px solid black; |
<html> | |
<head> | |
<script> | |
// Check for the various File API support. | |
if (window.File && window.FileReader && window.FileList && window.Blob) { | |
// Great success! All the File APIs are supported. | |
} else { |
// This script will boot app.js with the number of workers | |
// specified in WORKER_COUNT. | |
// | |
// The master will respond to SIGHUP, which will trigger | |
// restarting all the workers and reloading the app. | |
var cluster = require('cluster'); | |
var workerCount = process.env.WORKER_COUNT || 2; | |
// Defines what each worker needs to run |