Skip to content

Instantly share code, notes, and snippets.

View AccaliaDeElementia's full-sized avatar

Accalia Elementia AccaliaDeElementia

  • 15:37 (UTC -12:00)
View GitHub Profile
@AccaliaDeElementia
AccaliaDeElementia / a.js
Created July 22, 2015 01:19
secure versus unsecure framework, maybe?
'use strict';
function foo() {
setTimeout(function () {
console.log('foo!');
}, this.timeout);
}
function secure() {
value = secured;
exports.parseCommands = function parseCommands(post, events, callback) {
if (typeof callback !== 'function'){
throw new Error('callback must be supplied');
}
if (!events || typeof events.emit !== 'function'){
throw new Error('events must be supplied');
}
if (!post ||!post.raw){
callback(null, []);
return;
@AccaliaDeElementia
AccaliaDeElementia / gist:08e0c2319239d8038742
Created June 25, 2015 16:53
Updated sanitize with new tests (SockBot/es6-dev)
function sanitize(text) {
var edited = text.
// Normalize newlines
replace(/\r\n?/g, '\n').
// Remove low-ASCII control chars except \t (\x09) and \n (\x0a)
replace(/[\x00-\x08\x0b-\x1f]/g, '').
// Remove GFM-fenced code blocks