Skip to content

Instantly share code, notes, and snippets.

John Maguire JohnMaguire

Block or report user

Report or block JohnMaguire

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title> Wallboard Daemon Admin </title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" />
<style type="text/css">
h1 {
font-style: italic;
View keybase.md

Keybase proof

I hereby claim:

  • I am johnmaguire on github.
  • I am johnmaguire (https://keybase.io/johnmaguire) on keybase.
  • I have a public key whose fingerprint is 74E0 3311 17FC B721 C125 C430 19BE AD94 6ED2 DEE5

To claim this, I am signing this object:

View -
jmaguire@Styx [04:10:37] [~/go/src/github.com/johnmaguire/microfeed] [master *]
-> % go run main.go
main.go:5:2: cannot find package "github.com/johmaguire/microfeed/database" in any of:
/home/jmaguire/go/src/github.com/johnmaguire/microfeed/vendor/github.com/johmaguire/microfeed/database (vendor tree)
/usr/lib/go/src/github.com/johmaguire/microfeed/database (from $GOROOT)
/home/jmaguire/go/src/github.com/johmaguire/microfeed/database (from $GOPATH)
main.go:6:2: cannot find package "github.com/johmaguire/microfeed/web" in any of:
/home/jmaguire/go/src/github.com/johnmaguire/microfeed/vendor/github.com/johmaguire/microfeed/web (vendor tree)
/usr/lib/go/src/github.com/johmaguire/microfeed/web (from $GOROOT)
/home/jmaguire/go/src/github.com/johmaguire/microfeed/web (from $GOPATH)
View Cardinal.md

Installation

pip install cardinal

Usage

cardinal network create

Walks through creation of a network config.

View plugin.py
from cardinal.plugins import Plugin
from cardinal.decorators import requires
@requires('users')
class AdminPlugin(Plugin):
def __init__(self, cardinal):
self.cardinal = cardinal
def is_admin(self, nick, **kwargs):
View gist:e38478138e0dfd738323
info = [
'nick': 'Katorone',
'ident': 'death',
'user': 'Death, destroyer of worlds',
'vhost': '126.110-64-87.adsl-dyn.isp.belgacom.be',
'channels': ['#laerad', '#LaeradChat'],
'server': ('aperture.esper.net', 'Thank you for helping us help you help us all!'),
]
View plugin.py
class WhoisInfoPlugin(object):
@command('me')
def get_info(self, cardinal, user, channel, vhost):
nick = user.group(1)
cardinal.whois(nick, self._whois_callback)
def _whois_callback(self, nick, info):
self.info[nick] = info
@command('irc.330')
View plugin.py
from cardinal.decorators import command, help
from bs4 import BeautifulSoup
import requests
EROWID_URL = 'https://www.erowid.org'
class ErowidPlugin(object):
def __init__(self, cardinal):
View gist:80ead1176b783b34e732
// base.blade.php
<!doctype html>
<html>
<head>
<title>@section('title') My Homepage @show</title>
</head>
<body>
<!-- body -->
</body>
</html>
View new_plugins.md
  1. Plugins extend Plugin class
  2. Plugin class defines listenAndBlock() and listenFor() methods which wait for Cardinal events.
  3. Plugin class defines loop() with can be used to take control of the event loop. By default it calls listenAndBlock infinitely.
  4. Plugin class defines cardinal property as an interface used to talk over the pipes.
  5. Plugin class defines __init__() which by default just calls loop().

Example plugin:

You can’t perform that action at this time.