This file contains hidden or 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
class Foo | |
foo: () => | |
when 'pending' | |
if modelApprover() | |
this._setupEditButton() | |
this._setupRejectButton() | |
if pendingApprovalFromUser() | |
this._setupApproveButton() | |
This file contains hidden or 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
class user | |
key :approval_hierarchy, ApprovalHierarchy | |
end | |
class ApprovalHierarchy | |
attr_accessor :approval_hierarchy | |
def init(args=array of hashes) | |
approval_hierarchy = args | |
end |
This file contains hidden or 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
source :rubygems | |
gem 'bson_ext' | |
gem 'mongo_mapper', git: 'git://github.com/jnunemaker/mongomapper' |
This file contains hidden or 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
source :rubygems | |
gem 'mongo_mapper', git: 'git://github.com/jnunemaker/mongomapper' |
This file contains hidden or 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
def render_item(item) | |
if item.sell_price | |
"<b>#{item.name }</b>\n#{item.description } - #{item.sell_price }" | |
else | |
"<b>#{item.name }</b>\n#{item.description }" | |
end | |
end | |
def render_item(item) | |
"".tap do |str| |
This file contains hidden or 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
╭─evan@Evans-MBP ~/Desktop | |
╰─$ ruby ruby_reference.rb | |
1.9.2 | |
{:name=>"Nachos", :descriptions=>["Cheesy Chips"]} | |
{:name=>"Bagels", :descriptions=>["Really everything on it"]} | |
=-=-=-=-=-= | |
Before | |
{:name=>"Nachos", :descriptions=>["Cheesy Chips"]} | |
After |
This file contains hidden or 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
class ExampleApp < Sinatra::Base | |
configure :development do | |
logger = Logger.new 'log/query.log' | |
MongoMapper.connection = Mongo::Connection.new('127.0.0.1', 27017, :logger => logger) | |
MongoMapper.config = { 'development' => { 'uri' => 'mongodb://localhost/example_app-development' } } | |
MongoMapper.connect('development') | |
end | |
configure :test do | |
MongoMapper.database = "example_app-test" |
This file contains hidden or 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
<html> | |
<head> | |
<title>ASC</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script> | |
$(document).ready(function() { | |
$(window).scroll(function(){ | |
var topVal = 350 - $(window).scrollTop() * 1.3; | |
$("#cloud1").css({top: topVal}); | |
}); |
This file contains hidden or 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
SAVAGE VAMPIRES | |
(SW - WoD Quickie Conversion, Version 1.3) | |
by | |
Patrick Phillips (patrickphillips-at-hotmail.com) | |
I -- Introduction | |
This material is being used by me in a campaign in which the Camarilla are strictly NPC badguys. It's highly likely that the rules would need a little jiggering if you wanted to have vampire PCs. However, this at least gives you a place to start. |
This file contains hidden or 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
[ -z "$PS1" ] && return # If not running interactively, don't do anything | |
### Load other external chunks of code | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session. | |
source `brew --prefix`/Library/Contributions/brew_bash_completion.sh # Homebrew bash completion | |
source `brew --prefix`/etc/bash_completion.d/git-completion.bash # Homebrew installed git bash completion | |
### Color Shortctus | |
Color_Off='\e[0m' # Text Reset |
NewerOlder