Skip to content

Instantly share code, notes, and snippets.

View artob's full-sized avatar
⌨️
Coding

Arto Bendiken artob

⌨️
Coding
View GitHub Profile
# First, installed Go as per notes at <http://ar.to/notes/go>:
$ sudo port install go
$ export GOROOT=/opt/local/lib/go
$ export GOPATH=/tmp/go
$ go get -u -v github.com/mutecomm/mute/cmd/mutegenerate
github.com/mutecomm/mute (download)
github.com/mutecomm/mute/util/git
github.com/mutecomm/mute/def/version
github.com/mutecomm/mute/cmd/mutegenerate
@artob
artob / readme.txt
Created June 19, 2015 20:27
On age-related muscle loss
From "Practical Programming for Strength Training" [1] by Mark
Rippetoe, one of the foremost authorities in the field:
8<
As humans advance beyond middle-age, some significant changes
generally occur. Sarcopenia (loss of muscle cells), increased body
fat, performance loss, and reduced flexibility are common effects of
aging. This is largely because the average adult has a greatly reduced
activity level and becomes increasingly sedentary, which leads to a
@artob
artob / net-edit.pl
Last active October 10, 2015 21:24 — forked from morsik/net-edit.pl
#!/usr/bin/perl -w
# Author: Konrad "morsik" Mosoń <mosonkonrad@gmail.com>
# linked here: http://wiki.libvirt.org/page/Networking#Applying_modifications_to_the_network
use strict;
use warnings;
my $net = $ARGV[0];
@artob
artob / mqueue.asd
Created July 14, 2013 17:21
POSIX message queues for Common Lisp.
;; This is free and unencumbered software released into the public domain.
(asdf:defsystem :mqueue
:name "mqueue"
:description "POSIX message queues for Common Lisp."
:version "0.0.0"
:author "Arto Bendiken <arto@datagraph.org>"
:depends-on (:cffi)
:serial t
:components ((:file "mqueue")))
@artob
artob / bgp-query.rb
Created October 22, 2010 23:09
RDF.rb 0.3.0 BGP query example
#!/usr/bin/env ruby1.9
require 'rdf'
require 'rdf/ntriples'
RDF::Repository.load('http://rdf.rubyforge.org/doap.nt') do |rdf|
bgp = RDF::Query.new do
self << [:person, RDF.type, RDF::FOAF.Person]
self << [:person, RDF::FOAF.name, :name]
self << [:person, RDF::FOAF.mbox, :email]
end
@artob
artob / dawg_r2_spec.rb
Created October 17, 2010 12:22
DAWG test suite runner for SPARQL::Grammar::Parser
require File.join(File.dirname(__FILE__), 'spec_helper')
DAWG = RDF::Vocabulary.new('http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#')
MF = RDF::Vocabulary.new('http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#')
QT = RDF::Vocabulary.new('http://www.w3.org/2001/sw/DataAccess/tests/test-query#')
RS = RDF::Vocabulary.new('http://www.w3.org/2001/sw/DataAccess/tests/result-set#')
describe SPARQL::Grammar::Parser do
file = File.expand_path('./spec/dawg-test-suite/data-r2/manifest-syntax.ttl')
url = RDF::URI("file://#{file}")
@artob
artob / rspec-lisp.rb
Created August 23, 2010 16:21
Simple Ruby interface for evaluating Common Lisp code, for use with RSpec.
#!/usr/bin/env ruby -rubygems
#
# Simple Ruby interface for evaluating Common Lisp code, for use with RSpec.
# Written in August 2010 by Arto Bendiken <http://ar.to/>
#
# This is free and unencumbered software released into the public domain.
require 'open4' # `sudo gem install open4`
require 'sxp' # `sudo gem install sxp`
@artob
artob / grammar.rb
Created August 19, 2010 17:11
Possible syntax for parser combinators in Ruby.
module SXP
module Grammar extend Parallax::Grammar
LPAREN = char('(')
RPAREN = char(')')
INTEGER = term(/^([+-]?\d+)/) { |s| s.to_i }
STRING = term(/^"([^"]+)"/) { |s| s }
SYMBOL = term(/^([\w\d_-]+)/) { |s| s.to_sym }
Atom = INTEGER | STRING | SYMBOL
List = LPAREN << +Atom >> RPAREN
@artob
artob / rdf_context.md
Created April 2, 2010 04:14
RDF.rb <-> RdfContext mapping (work-in-progress)

RDF.rb === RdfContext

This is a quick overview and mapping between RDF.rb and RdfContext, two RDF libraries for Ruby, to serve as an aid in determining whether the projects would benefit from aligning goals and direction.

An experimental fork of RdfContext that attempts some integration between the two object models:

module RDF::Raptor
##
# RDF/XML support.
module RDFXML
##
# RDF/XML format specification.
class Format < RDF::Raptor::Format
content_type 'application/rdf+xml', :extension => :rdf
content_encoding 'utf-8'
rapper_format :rdfxml