This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
Module dependencies | |
### | |
require.paths.unshift "#{__dirname}/lib/support/express-csrf/" | |
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/" | |
express = require 'express' | |
app = module.exports = express.createServer() | |
RedisStore = require 'connect-redis' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.\" README.EXT - -*- Text -*- created at: Mon Aug 7 16:45:54 JST 1995 | |
This document explains how to make extension libraries for Ruby. | |
1. Basic knowledge | |
In C, variables have types and data do not have types. In contrast, | |
Ruby variables do not have a static type, and data themselves have | |
types, so data will need to be converted between the languages. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'rack' | |
class Object | |
def webapp | |
class << self | |
define_method :call do |env| | |
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?) | |
[200, {}, send(func, *attrs)] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@ip-10-251-122-82:/home/lavender/spocq/src/test/rspec/tests/data-r2/i18n# curl http://tmp.datagraph.org.s3.amazonaws.com/import/33f361f0-d1b2-012d-f3cf-0023df827da6 > curl | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
113 795 113 795 0 0 47522 0 --:--:-- --:--:-- --:--:-- 56785 | |
root@ip-10-251-122-82:/home/lavender/spocq/src/test/rspec/tests/data-r2/i18n# diff curl normalization-01.ttl | |
root@ip-10-251-122-82:/home/lavender/spocq/src/test/rspec/tests/data-r2/i18n# ls -al curl normalization-01.ttl | |
-rw-r--r-- 1 root root 795 2010-11-14 00:21 curl | |
-rw-r--r-- 1 lavender lavender 795 2010-10-29 05:46 normalization-01.ttl | |
root@ip-10-251-122-82:/home/lavender/spocq/src/test/rspec/tests/data-r2/i18n# irb1.9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[INFO] (src/control.rl:207) Setting up control socket in at ipc://run/control | |
[INFO] (src/handler.c:202) MAX allowing limits.handler_targets=128 | |
[INFO] (src/handler.c:275) Binding handler PUSH socket tcp://127.0.0.1:9997 with identity: test | |
[INFO] (src/handler.c:297) Binding listener SUB socket tcp://127.0.0.1:9996 subscribed to: test | |
^C[INFO] (src/mongrel2.c:83) SHUTDOWN REQUESTED: GRACEFUL (SIGINT again to EXIT NOW) | |
[ERROR] (src/task/net.c:241: errno: Bad file descriptor) Failed calling accept on socket that was ready. | |
[INFO] (src/mongrel2.c:312) Shutdown requested, goodbye. | |
[ERROR] (src/handler.c:169: errno: Resource temporarily unavailable) Receive on handler socket failed. | |
[INFO] (src/mongrel2.c:252) Waiting for connections to die: -1 | |
[INFO] (src/mongrel2.c:261) Removing pid file ./run/mongrel2.pid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'ruby-debug' | |
require 'spira' | |
require 'rdf/rdfxml' | |
require 'sparql/client' | |
class Actor | |
include Spira::Resource |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install PostgreSQL 9 in Mac OSX via Homebrew | |
Mac OS X Snow Leopard | |
System Version: Mac OS X 10.6.5 | |
Kernel Version: Darwin 10.5.0 | |
Install notes for PostgreSQL 9.0.1 install using Homebrew: | |
sh-3.2# brew install postgresql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
After embedding the following JavaScript within your <head> element you can semantically | |
mark those who are asshats. The <asshat></asshat> tag is often used to replace <cite> | |
when quoting sources. The script will work in all flavours of IE and modern browsers. | |
Now where is my </sarcasm> tag? | |
This is free and unencumbered software released into the public domain. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%w[address_1 city state zip_code].each do |attr| | |
validates_presence_of attr, unless: ->(org) { org.send(attr).nil? } | |
end |