Skip to content

Instantly share code, notes, and snippets.

View AccaliaDeElementia's full-sized avatar

Accalia Elementia AccaliaDeElementia

  • 23:38 (UTC -12:00)
View GitHub Profile
@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
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 / 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;
@AccaliaDeElementia
AccaliaDeElementia / Example.json
Created August 4, 2015 11:46
Example SockBot Config files
{
"core": {
"username": "sockAdept",
"password": "this is still not my password"
},
"plugins": {
"echo": true
}
}
beforeEach(() => {
sinon.stub(child_process, 'spawn');
hostProcess = {
execPath: '/foo/bar/node',
execArgv: [],
argv: ['node', './lib/app.js']
};
});
beforeEach(() => child_process.spawn.restore());
[02:24:58] Polling Messages
[02:26:01] Polling Notifications
[02:27:02] Polling Messages
[02:27:06] Polling Messages
[02:27:37] Polling Messages
[02:28:11] Polling Messages
[02:28:51] Polling Messages
[02:29:43] Polling Messages
[02:30:59] Polling Messages
[02:31:59] Polling Notifications
'use strict';
const fs = require('fs');
const util = require('../util');
let client;
function reader() {
fs.createReadStream(exports.config.pipe)
.on('data', (data) => {
client.say(exports.config.channel, data);
})
// ==UserScript==
// @name Mafia Mod Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://what.thedailywtf.com/*
// @grant none
// ==/UserScript==
// ==UserScript==
// @name YoutubeEmbedder
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Accalia <accalia@elementia.me>
// @match https://www.youtube.com/watch*
// @match http://www.youtube.com/watch*
// @grant none
// ==/UserScript==
street_number street_name street_suffix unit_number city state postal_code listing_id price bathrooms bedrooms lat long
146 Mission AZ 85010 1 83815 4 4 -134.85 15.85
983 Mission AZ 85009 2 33273 4 1 -66.22 16.85
455 Turk AZ 85012 3 34590 2 2 165.55 22.2
16 Franklin AZ 85013 4 106407 2 3 160.26 85.1
997 Euclid AZ 85018 5 78390 4 3 -90.82 -23.46
136 4th AZ 85015 6 21776 2 4 -151.83 85.61
739 9th Phoenix AZ 85011 7 54984 4 2 -142.67 4.8
854 Pine Trl AZ 85021 8 37980 4 4 14.69 69.53
739 9th AZ 85011 9 44092 4 4 -158.44 -19.86