Skip to content

Instantly share code, notes, and snippets.

lass ClassRegistry
#Extend a module with this in order to make it the registrar for a
#particular purpose.
#The top of a class heirarchy will make "register" immediately available
#to subclasses. Otherwise, classes can say Module::registry.add(name,
#self)
#
module Registrar
def registry
@registry ||= ClassRegistry.new(self)
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<Affordance> a rdfs:Class ;
rdfs:comment "Base class for all affordances" .
<Null> a rdfs:Class ;
rdfs:subClassOf <Affordance> ;
rdfs:comment "The provided affordance is null. i.e. not dereferenceable, no actions provided".
@nyarly
nyarly / javascript.vim
Last active December 28, 2015 20:39
How To Make The Javascripts
set backupcopy=yes
Root = function(element, indexes){
function constructor(){
this.setup(null, element, indexes); //defined in grandparent
};
constructor.prototype = new Group(null, element, indexes); //parent
return new constructor();
};
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
rspec ./spec/controllers/demo_impressions_controller_spec.rb:84 # DemoImpressionsController when a demo PG ad with offers is requested should render a PG ad that has offers
rspec ./spec/controllers/impressions_controller_spec.rb:137 # ImpressionsController with successful ad fetch with PG offer ads should render it's views and should load successfully
rspec ./spec/jobs/ad_cache_page_spec.rb:17 # AdCachePage should find appropriate Pricegrabber ads for page
rspec ./spec/jobs/refresh_page_spec.rb:28 # RefreshPage on a finished page should not raise error
rspec ./spec/jobs/refresh_page_spec.rb:34 # RefreshPage on a finished page should enqueue next job
rspec ./spec/jobs/refresh_page_spec.rb:40 # RefreshPage on a finished page should reset AdCachePage
rspec ./spec/jobs/refresh_page_spec.rb:47 # RefreshPage on a finished page should reset FinishPage
rspec ./spec/lib/ad_engine/ad_finder_spec.rb:228 # AdEngine::AdFinder get ads with no ilk given with a query should return ads of both pg and groupon
rspec ./spec/lib/
<p>I've recently gotten really excited about REST (or Hypermedia APIs) and about RDF. Here's a quick trail of breadcrumbs about why. Come be excited.</p>
<A HREF="http://vimeo.com/20781278" >Hypermedia APIs - Jon Moore on Vimeo</A>
<A HREF="https://gist.github.com/jonm/1445773" >Shallow vs. deep representations in XHTML Hypermedia APIs</A>
<A HREF="http://www.w3.org/TR/2011/WD-microdata-20110405/" >HTML Microdata</A>
<A HREF="http://markmail.org/message/mlf5fmvtkvaxa7co" >Re: [whatwg] Proposal to extend Microdata API specification - Ian Hickson - org.whatwg.lists.whatwg - MarkMail</A>
<A HREF="http://manu.sporny.org/2012/mythical-differences/" >Mythical Differences: RDFa Lite vs. Microdata | The Beautiful, Tormented Machine</A>
<A HREF="http://www.w3.org/TR/rdfa-lite/" >RDFa Lite 1.1</A>
@nyarly
nyarly / fu.rb
Last active December 14, 2015 03:38
class Uuu < RSpec::Core::Formatters::ProgressFormatter
def example_passed(example)
if @failed_examples.empty?
super
else
output.print red("u")
end
end
end
@nyarly
nyarly / utils.rb
Last active December 13, 2015 19:38
def align(string)
lines = string.split(/\n/)
first = lines.shift
match = /^(\s*)<<</.match(first)
unless(match.nil?)
return lines.map do |line|
unless /^#{match[1]}|^\s*$/ =~ line
raise Errors::UnderIndented, line
end
line.sub(/^#{match[1]}/, "")
export PROMPT_DIRTRIM=2
if [[ ! $PROMPT_COMMAND =~ __bundler_prompt_command ]]; then
export PROMPT_COMMAND="${PROMPT_COMMAND:-:} ; __bundler_prompt_command"
fi
# Put your fun stuff here.
PS1='\[\033[01;31m\]$(__bundler_ps1)\[\033[00;34m\]\[\033[32m\]\u@\h\[\033[34m\] \w\[\033[01;32m\]$(__git_ps1) \[\033[34m\]\$\[\033[00m\] '