Skip to content

Instantly share code, notes, and snippets.

** Local
git init
git svn clone svn+ssh://scm.server.com/apps/your_app --trunk=trunk --branches=branches --tags=tags .
git remote add origin git@scm.server.com:/apps/your_app
git push origin master
** in other computers
git clone git@scm.server.com:/apps/your_app
# Migration
create_table "posts" do |t|
t.string "title_ar"
t.string "title_en"
t.text "body_en"
t.text "body_ar"
end
# Model
class Post < ActiveRecord::Base
# Use the plugin in your model
class Video < ActiveRecord::Base
acts_as_featurable
end
# Call the feature! method to feature an object.
v = Video.find :first
v.feature!
v.featured? => true
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:tme="http://ccjr.name/rdf/1.0/">
<rdf:Description rdf:about="record1">
<tme:student>680012</tme:student>
</rdf:Description>
<rdf:Description rdf:about="record1">
<tme:course>Comp492</tme:course>
</rdf:Description>
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#">
<rdf:Bag>
<rdf:li rdf:resource="BeckySmith"/>
<rdf:li rdf:resource="JohnSmith"/>
</rdf:Bag>
<rdf:Description rdf:about="BeckySmith">
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<rdfs:Class rdf:ID="Team">
<rdfs:comment>Team Class</rdfs:comment>
<rdfs:subClassOf rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Resource"/>
</rdfs:Class>
<rdf:Property rdf:ID="name">
<?xml version='1.0' encoding='UTF-8'?>
<rdf:RDF xmlns:tme2="http://ccjr.name/comp492/tme2#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<tme2:AssociateProfessor rdf:about="http://ccjr.name/comp492/tme2#Xiaokun Zhang"/>
<tme2:GraduateCourse rdf:about="http://ccjr.name/comp492/tme2#Comp 680">
<tme2:isWroteBy rdf:resource="http://ccjr.name/comp492/tme2#Xiaokun Zhang"/>
</tme2:GraduateCourse>
<tme2:UndergraduateCourse rdf:about="http://ccjr.name/comp492/tme2#Comp 492">
<tme2:isWroteBy rdf:resource="http://ccjr.name/comp492/tme2#Xiaokun Zhang"/>
<?xml version='1.0' encoding='UTF-8'?>
<rdf:RDF xmlns:ac="http://uni.edu/academic#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<ac:UndergraduateStudent rdf:about="http://uni.edu/academic#JohnSmith">
<ac:name>John Smith</ac:name>
<ac:email>john@uni.edu</ac:email>
<ac:phone>+1 123 4567890</ac:phone>
</ac:UndergraduateStudent>
<owl:Class rdf:ID="Beer">
<rdfs:subClassOf rdf:resource="#Beverage"/>
<owl:disjointWith rdf:resource="#Juice"/>
<owl:disjointWith rdf:resource="#Water"/>
</owl:Class>
<owl:Class rdf:ID="R">
<owl:intersectionOf rdf:parseType="Collection">
<owl:Class rdf:about="#A" />
<owl:Class rdf:about="#B1" />
<owl:Class rdf:about="#B2" />
<owl:Restriction>
<owl:onProperty>
<owl:DatatypeProperty rdf:ID="p1"/>
</owl:onProperty>
<owl:hasValue rdf:datatype="http://www.w3.org/2001/XMLSchema#int"