Skip to content

Instantly share code, notes, and snippets.

View scottwater's full-sized avatar

Scott Watermasysk scottwater

View GitHub Profile
"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;}
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
source :gemcutter
gem 'sinatra', '1.1.0', :git => 'http://github.com/sinatra/sinatra.git'
gem 'RedCloth', '4.2.3'
function mkgemset() {
mkdir $1
echo 'source :gemcutter' > $1/Gemfile
touch $1/Rakefile
echo 'rvm_gemset_create_on_use_flag=1\nrvm gemset use' $1 > $1/.rvmrc
cd $1
git init
mate .
}
private static IEnumerable<AuditParameter> GetParametersFromEnumeration(IEnumerable args)
{
var parameters = new List<AuditParameter>();
foreach(var arg in args)
{
var iaudit = arg as IAuditableParameter;
if(iaudit != null)
{
parameters.Add(new AuditParameter {Value = iaudit.AuditParameter});
continue;
public class BaseClass
{
public string STRING { get { return "Base"; } }
}
public class ChildClass : BaseClass
{
public new string STRING { get { return "Child"; } }
}