Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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.
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="script.js"></script>
<style>
nav#main a[data-current] { color: red; }
</style>
<nav id="main">
<a href="#!/">A</a>
<a href="#!/derp">B</a>
console.log("Hello from thesides!");
function fib(n) {
return n < 2 ? n : fib(n-1) + fib(n-2);
}
console.log("Fib(5): " + fib( 5));
console.log("Fib(15): " + fib(15));
console.log("Fib(25): " + fib(25));
console.log("Fib(35): " + fib(35));
@passcod
passcod / toSource2.coffee
Last active December 11, 2015 09:08
Gecko-style #toSource() shim
toSource2 = (data) ->
typ = typeof data
if typ == "number" and isNaN data
"NaN"
else if ["string", "number", "boolean"].indexOf(typ) != -1
JSON.stringify data
else if typ == "function"
"(#{data.toString()})"
else if data instanceof Array
"[#{data.map(toSource2).join(", ")}]"
@passcod
passcod / minecraft.service
Created February 6, 2013 05:10
Minecraft Plong Setup
#!/bin/bash
echo "Tmux !!!"
tmux new-session -d /home/mc/launch.sh
@passcod
passcod / fib.js
Created February 9, 2013 08:55
Fibonacci bench
function fib(n) {
return n < 2 ? n : fib(n-1) + fib(n-2);
}
print(fib(35));