This file contains 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
/* | |
* User: scorder | |
* Date: 7/8/2009 | |
* | |
* Updated: 2/1/2010 | |
* User: scottwater | |
* Minor changes to Document to make it play nicely with | |
* C# 4.0 dynamics | |
*/ | |
using System; |
This file contains 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
public class Post | |
{ | |
public virtual int Id { get; set; } | |
public virtual string Title { get; set; } | |
public virtual string Body { get; set; } | |
public virtual DateTime PubDate { get; set; } | |
public virtual ICollection<Tag> Tags { get; set; } | |
} |
This file contains 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 'sinatra' | |
require 'consistenturls' | |
#plugin | |
validate_url_requests | |
get '/' do | |
"Hello World" | |
end |
This file contains 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
"one, two, three, one, four, one".split(',').collect{|s| s.strip}.uniq == ["one","two","three","four"] |
This file contains 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
public class Forum | |
{ | |
public ObjectId Id{get;set;} | |
public string Name{get;set;} | |
//no reference to all the posts | |
} | |
public class Thread | |
{ | |
public ObjectId Id{get;set;} |
This file contains 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
using System.Collections.Generic; | |
using MongoDB.Driver; | |
namespace DynoMongo | |
{ | |
public class DynoCollection | |
{ | |
private IMongoCollection _col; | |
public DynoCollection(IMongoCollection col) |
This file contains 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 'digest/sha1' | |
class Account | |
include MongoMapper::Document | |
attr_accessor :password | |
# Keys | |
key :name, String | |
key :surname, String | |
key :email, String |
This file contains 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
Rake task: | |
task :version do | |
puts RUBY_VERSION | |
end | |
Terminal Output: | |
→ rvm list |
This file contains 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
# COMMENT OF SCRIPT HERE | |
# you can make as many tabs as you wish... | |
# tab names are actually arbitrary at this point too. | |
--- | |
- tab1: | |
- title 'Git' | |
- cd ~/code/tekyll | |
- mate . | |
- clear | |
- tab2: |
This file contains 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 'sj' | |
run SinatraJekyll |
OlderNewer