Skip to content

Instantly share code, notes, and snippets.

@passcod
passcod / gist:4158973
Created November 28, 2012 04:08
in no particular order
  • 4Chan: Community where everything matters but everyone is anonymous.
  • StackOverflow: Geek community where only knowledge matters and anonymity is optional.
  • Imgur: Community where the username is most often part of the message.
  • IRC: Not a community. The common room of your community's lodgings.
  • Twitter: Nobody's really sure what exactly it is.
  • Facebook: Originally made by a douchebag, now home to many more.
  • MySpace: Where bands hang out before they die.
  • Bandcamp: Where the rest of the bands are.
  • YouTube: One of the rare things that has gotten better after Google bought it.
  • Github: Code. Code-code-code. Octopuses. Lolcats.
@passcod
passcod / nano.py
Created November 24, 2012 03:57
•AZ•BOT• mod for NaNoWriMo
# coding: utf-8
"""
NaNoWriMo.org helper mod
Provides wordcounts (.wc) and word war
(.sprint) helpers.
Depends on:
core mods (azbot >= 1.4.0)
lxml
@passcod
passcod / perso.py
Created November 24, 2012 01:38
Personality mod for •AZ•BOT•
# coding: utf-8
"""
Personality mod
Scans all conversation and intervenes
when it picks up on specific patterns.
Responses are varied randomly, and most
have a mood index; mood is changed by
whetever you say to the bot.
@passcod
passcod / chan.py
Created November 24, 2012 00:47
•AZ•BOT• channel mgmt tools
# coding: utf-8
"""
Channel management
Depends on:
core mods (azbot >= 1.4.0)
"""
import _util
def join(opts, args=[]):
@passcod
passcod / wa.py
Created November 23, 2012 20:36
Wolfram|Alpha mod for •AZ•BOT•
"""
Wolfram|Alpha mod
Provides .wa and .time and other
calculation-related commands.
Depends on:
core mods (azbot >= 1.4.0)
wolframalpha (pip install ~)
@passcod
passcod / gist:4129243
Created November 22, 2012 03:05
xbot nanowrimo sprint module/script
# Append to: nanowrime.py
import time
import datetime
from threading import Thread
class nanotimer(Thread):
def set(self, time = 15, func = lambda: 0, *args):
self.time = time * 60
self.func = func
@passcod
passcod / gist:4057531
Created November 12, 2012 04:29
Async language? (WIP)

I'm thinking about a language concept. Dunno if it already exists or what. Just a random idea. For convenience, let's call it Rall (for Random Async/Lazy Language). For simplicity's sake, I've made the syntax similar to Python or Ruby or CoffeeScript.


In a normal language:

# doA() will run, complete,
# and return.
@passcod
passcod / markov.py
Created November 10, 2012 04:32
Markov-Chain brain/bot for •AZ•BOT•
"""
Markovbot mod
Depends on:
core mods (>= 1.3.0)
Config options:
markovbot:
# These are good defaults. Change with care.
@passcod
passcod / _cleverbot.py
Created November 10, 2012 04:31
Cleverbot mod for •AZ•BOT•
#!/usr/bin/python
"""
https://code.google.com/p/pycleverbot
This library lets you open chat session with cleverbot (www.cleverbot.com)
Example of how to use the bindings:
>>> import cleverbot
>>> cb=cleverbot.Session()
>>> print cb.Ask("Hello there")
@passcod
passcod / attack
Created November 5, 2012 07:55
Proposed library functions for xbot
// Proposed by passcod @ Nov 07 2012 06:47:22
self.attack = function(to) {
var user = to || Object.keys(bot.users)[Math.floor(Object.keys(bot.users).length * Math.random())];
var attack = store.attacks[Math.floor(store.attacks.length * Math.random())];
return attack.replace(/\{defender\}/g, user).replace(/\{attacker\}/g, bot.caller).replace(/{year}/g, Math.round(Math.random() * 10000) + (Math.random() * 100 < 35 ? "BC" : ""));
}