Skip to content

Instantly share code, notes, and snippets.

View artob's full-sized avatar
⌨️
Coding

Arto Bendiken artob

⌨️
Coding
View GitHub Profile
class Item
include Spira::Resource(SIOC.Item)
property :title, DC.title, String
property :content, SIOC.content, String
property :created, DC.created, DateTime
property :creator, SIOC.has_creator, UserAccount
property :item, SIOC.about, self
property :has_reply, SIOC.has_reply, self
property :reply_of, SIOC.reply_of, self # IFP of :has_reply
@artob
artob / lockmem.c
Created November 19, 2009 18:06
lockmem.c: grabs and locks a specified amount of memory
/**
* lockmem.c: grabs and locks a specified amount of memory
*
* Written by Arto Bendiken <http://ar.to/>
* Compile using "gcc -o lockmem lockmem.c"
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@artob
artob / openpgp_spec.log
Created August 1, 2009 15:38
OpenPGP.rb specs
OpenPGP::Message at <http://ar.to/pgp.txt>
when dearmored
should return a binary string of 1,939 bytes
should have the CRC24 checksum of 0x3B1080
when parsed
should return a sequence of packets
should contain a public key packet
should contain a public subkey packet
should contain three user ID packets
@artob
artob / assembler.rb
Created July 26, 2009 15:35
Simple JVM assembler based on the BiteScript gem for JRuby.
# Simple JVM assembler using the BiteScript gem for JRuby.
# @see http://kenai.com/projects/jvmscript
require 'rubygems'
require 'bitescript'
class JVM
class Assembler
attr_reader :options
def self.compile(name, options = {}, &block)