Skip to content

Instantly share code, notes, and snippets.

View watilde's full-sized avatar
👋
Hi

Daijiro Wachi watilde

👋
Hi
View GitHub Profile
@watilde
watilde / markdownHook.js
Last active August 29, 2015 14:24 — forked from Marak/markdownHook.js
hook.io microservice for rendering markdown to HTML
module['exports'] = function markdownHook (hook) {
var marked = require('marked');
// TODO: expose parser options through schema
marked.setOptions({
renderer: new marked.Renderer(),
gfm: true,
tables: true,
breaks: false,
pedantic: false,
sanitize: true,
// applicationCacheの更新を妨害する
Object.defineProperty(this,'applicationCache',{get:function(){return{}}});
(function () {
// AppCache上でlocation.hrefを読み込むとAppCacheの内容を読み込むため、「ブラウザは別URLと認識するが、サーバは同じコンテンツを返すURL」を作る
contentLoad(location.href+'/');
// 本来であればsubmit等のイベントもキャッチする必要がある
window.addEventListener('click', function (evn) {
var elem = evn.target;
while (elem.tagName.toLocaleLowerCase() != 'a') elem = elem.parentNode;
@watilde
watilde / clients.md
Last active August 29, 2015 13:56 — forked from defunkt/clients.md

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support