Skip to content

Instantly share code, notes, and snippets.

"use strict";
var req = require('request' ),
opts = require('./config.json');
twoStepLogin(
'https://openid.stackexchange.com/account/login',
'https://openid.stackexchange.com/account/login/submit');
function twoStepLogin (loginUrl, submitUrl, next) {
var ids = $('#access-section-read-write .usercard').map(function () { return /\d+/.exec(this.id); }).toArray()
function remove (userId, cb) {
$.post('/rooms/setuseraccess/17', fkey({
aclUserId : userId,
userAccess : 'remove'
})).always(cb);
}
(function step (ids) {
@Zirak
Zirak / result.org
Last active August 29, 2015 14:02

Vote results:

commandvotes
awsm16
norris14
domain13
zalgo13
meme11
inhistory9
todo8
Changes from HEAD to working tree
6 files changed, 195 insertions(+), 132 deletions(-)
source/bot.js | 65 +------------------------
source/memory.js | 103 ++++++++++++++++++++++++++++++++++++++++
source/plugins/export.js | 32 -------------
source/plugins/import-export.js | 82 ++++++++++++++++++++++++++++++++
source/plugins/import.js | 35 --------------
source/util.js | 10 +++-
Modified source/bot.js
NumericLiteral ::
DecimalLiteral
HexIntegerLiteral
OctalIntegerLiteral
DecimalLiteral ::
DecimalIntegerLiteral . DecimalDigits(opt) ExponentPart(opt)
...
DecimalIntegerLiteral ::
// hi, this explains the current bot architecture. comment pl0x.
// this is the object which the bot sees (and all listeners/commands receive)
var message = {
text : 'message text sans any invocation stuff',
user : {
name : '',
id : '',
reputation : '',
isOwner : function () { /*...*/ }
@Zirak
Zirak / index.js
Created December 13, 2014 01:55
requirebin sketch
var Promise = require('bluebird');
new Promise(function (resolve, reject) {
reject(new Error('I am grumpy'));
}).catch(function (err) {
console.warn('grumpyness averted!', err);
}).then(function () {
throw new Error('muahahaha');
});
@Zirak
Zirak / shell.js
Last active August 29, 2015 14:16
var readline = require('readline'),
fs = require('fs'),
tty = require('tty');
var device = fs.openSync('/dev/ttyO4', 'r+');
var rstream = new tty.ReadStream(device),
wstream = new tty.WriteStream(device);
rstream.on('data', function (chunk) {
void V8InjectedScriptHost::internalConstructorNameMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (info.Length() < 1 || !info[0]->IsObject())
return;
v8::Local<v8::Object> object = info[0].As<v8::Object>();
v8::Local<v8::String> result = object->GetConstructorName(); // <-- bug here
if (!result.IsEmpty() && toCoreStringWithUndefinedOrNullCheck(result) == "Object") {
v8::TryCatch tryCatch;
@Zirak
Zirak / improvements.md
Last active August 29, 2015 14:20
Bunch of ideas to improve the devtools

(of course, the dev tools are insanely awesome, but everything has its quirks).

Console

> { a: 4 }
4
> { a: 4, b: 5 }
SyntaxError
// why not figure out it's an object literal, auto-wrap in parentheses?