Skip to content

Instantly share code, notes, and snippets.

View scottwater's full-sized avatar

Scott Watermasysk scottwater

View GitHub Profile
/*
* 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;
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; }
}
require 'rubygems'
require 'sinatra'
require 'consistenturls'
#plugin
validate_url_requests
get '/' do
"Hello World"
end
"one, two, three, one, four, one".split(',').collect{|s| s.strip}.uniq == ["one","two","three","four"]
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;}
using System.Collections.Generic;
using MongoDB.Driver;
namespace DynoMongo
{
public class DynoCollection
{
private IMongoCollection _col;
public DynoCollection(IMongoCollection col)
require 'digest/sha1'
class Account
include MongoMapper::Document
attr_accessor :password
# Keys
key :name, String
key :surname, String
key :email, String
Rake task:
task :version do
puts RUBY_VERSION
end
Terminal Output:
→ rvm list
# 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:
require 'sj'
run SinatraJekyll