Skip to content

Instantly share code, notes, and snippets.

Scott Watermasysk scottwater

Block or report user

Report or block scottwater

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Document.cs
/*
* 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;
View Post.cs
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; }
}
View demo_app.rb
require 'rubygems'
require 'sinatra'
require 'consistenturls'
#plugin
validate_url_requests
get '/' do
"Hello World"
end
View gist:310387
"one, two, three, one, four, one".split(',').collect{|s| s.strip}.uniq == ["one","two","three","four"]
View gist:319648
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;}
View DynoCollection.cs
using System.Collections.Generic;
using MongoDB.Driver;
namespace DynoMongo
{
public class DynoCollection
{
private IMongoCollection _col;
public DynoCollection(IMongoCollection col)
View account.rb
require 'digest/sha1'
class Account
include MongoMapper::Document
attr_accessor :password
# Keys
key :name, String
key :surname, String
key :email, String
View gist:538044
Rake task:
task :version do
puts RUBY_VERSION
end
Terminal Output:
→ rvm list
View tekyll.yml
# 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:
View config.ru
require 'sj'
run SinatraJekyll
You can’t perform that action at this time.