Skip to content

Instantly share code, notes, and snippets.

Avatar
🍵
Watchexec: on a coding break, will answer issues

Félix Saparelli passcod

🍵
Watchexec: on a coding break, will answer issues
View GitHub Profile
@passcod
passcod / wa.py
Created Nov 23, 2012
Wolfram|Alpha mod for •AZ•BOT•
View wa.py
"""
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 Nov 24, 2012
•AZ•BOT• channel mgmt tools
View chan.py
# coding: utf-8
"""
Channel management
Depends on:
core mods (azbot >= 1.4.0)
"""
import _util
def join(opts, args=[]):
@passcod
passcod / perso.py
Created Nov 24, 2012
Personality mod for •AZ•BOT•
View perso.py
# 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 Nov 24, 2012
•AZ•BOT• mod for NaNoWriMo
View nano.py
# 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 Nov 28, 2012
in no particular order
View gist:4158973
  • 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.
View index.html
<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>
View gist:4516319
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 Dec 11, 2015
Gecko-style #toSource() shim
View toSource2.coffee
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 Feb 6, 2013
Minecraft Plong Setup
View minecraft.service
#!/bin/bash
echo "Tmux !!!"
tmux new-session -d /home/mc/launch.sh
@passcod
passcod / fib.js
Created Feb 9, 2013
Fibonacci bench
View fib.js
function fib(n) {
return n < 2 ? n : fib(n-1) + fib(n-2);
}
print(fib(35));