Skip to content

Instantly share code, notes, and snippets.

#include "mowgli.h"
int main(void)
{
char *x, *y;
x = mowgli_strdup("the quick brown fox jumped over the lazy dog");
printf("%s\n", x);
y = x+10;
printf("%s\n", y);
@alyx
alyx / hash.py
Created May 27, 2012 23:58
Sigyn sha512 command
import _sigyn as s
import hashlib
def hash(command, target, data, nick, user, host, hostmask):
hashable = data[data.find(" ")+1:];
s.irc_privmsg(target, hashlib.sha512(hashable).hexdigest());
return;
s.cmd_add(hash, "sha512", 1, s.AC_NONE, "Returns a hex digest of the SHA512 hash of the given string", "<string>")
@alyx
alyx / issues.js
Created May 27, 2012 21:53
JIRA issue information thing
var irc = require('irc'),
JiraApi = require('jira').JiraApi;
var user = 'user',
pass = 'pass',
ircuser = 'user',
ircpass = 'pass';
var jira = new JiraApi('http', 'jira.arinity.org', 80, user, pass, 'latest');
var client = new irc.Client('irc.staticbox.net', 'issues', { userName: 'issues', realName: 'Sigyn Issue Monitor', port: 6667, channels: ['#sigyn']});
From d860acdd324b7be0b264e926b1f76a69c99a27d1 Mon Sep 17 00:00:00 2001
From: Alyx <[email protected]>
Date: Sun, 19 Feb 2012 04:55:57 -0700
Subject: [PATCH] Remove double-declared typedef, change kqueue to use the
correct types when defining things.
---
src/libmowgli/eventloop/eventloop.h | 2 --
src/libmowgli/eventloop/kqueue_pollops.c | 2 +-
2 files changed, 1 insertions(+), 3 deletions(-)
From 330f22ee350a8dd843f2c7ca80f1b67a928ad446 Mon Sep 17 00:00:00 2001
From: Alyx <[email protected]>
Date: Sun, 19 Feb 2012 04:47:50 -0700
Subject: [PATCH] Remove a double-declared typedef, create
mowgli_pollevent_dispatch_func_t. Things compile now.
---
src/libmowgli/eventloop/eventloop.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
@alyx
alyx / free.pl
Created November 18, 2011 03:31
#!/usr/bin/perl
##
## freebsd-memory -- List Total System Memory Usage
## Copyright (c) 2003-2004 Ralf S. Engelschall <[email protected]>
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions
## are met:
## 1. Redistributions of source code must retain the above copyright
## notice, this list of conditions and the following disclaimer.
/* Sigyn - A reasonably sane IRC bot.
* Copyright (c) Alexandria Wolcott <[email protected]>
* Released under the BSD license.
*/
#include "sigyn.h"
mowgli_heap_t *command_heap;
mowgli_list_t commands;
@alyx
alyx / tokenize.c
Created October 9, 2011 23:11
tokenizer with memory asplosion
/* Sigyn - A reasonably sane IRC bot.
* Copyright (c) Alexandria Wolcott <[email protected]>
* Released under the BSD license.
*/
#include "sigyn.h"
int tokenize(char *message, char **parv)
{
int i;
use strict;
use warnings;
use Data::Dumper;
my %people = (
cody => {
friends => ['aaron', 'alyx', 'foo', 'cow']
},
aaron => {
friends => ['alyx', 'cody', 'foo', 'bar', 'moo', 'cow']
************* Module bot
C: 17: Invalid name "cg" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
C: 18: Invalid name "cfile" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
C: 21: Invalid name "cg" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
C: 22: Invalid name "cfile" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
C: 24: Invalid name "conf" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
W: 62:IRCCli.onjoin: No exception type(s) specified
E: 61:IRCCli.onjoin: Class 'events' has no 'join' member
C: 62:IRCCli.onjoin: More than one statement on a single line
W: 66:IRCCli.onpart: No exception type(s) specified