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 Application | |
include Mongoid::Document | |
references_many :items | |
references_many :templates | |
references_many :users, :stored_as => :array, :inverse_of => :applications | |
end | |
class User | |
include Mongoid::Document |
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 Application | |
include Mongoid::Document | |
embeds_many :items | |
embeds_many :templates | |
references_many :users, :stored_as => :array, :inverse_of => :applications | |
end | |
class User | |
include Mongoid::Document |
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
#!/bin/sh -x | |
# hack: Merge the latest changes from the master branch into your current branch | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || exit 0 | |
CURRENT="${ref#refs/heads/}" | |
git checkout development | |
git pull origin development | |
git checkout ${CURRENT} | |
git rebase development |
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
#!/bin/sh -x | |
# hack: Merge the latest changes from the master branch into your current branch | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || exit 0 | |
CURRENT="${ref#refs/heads/}" | |
git checkout development | |
git pull origin development | |
git checkout ${CURRENT} | |
git rebase development |
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
#!bash | |
# | |
# bash completion support for core Git. | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]> | |
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# The contained completion routines provide support for completing: | |
# |
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
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo "("${ref#refs/heads/}")" | |
} | |
BRIGHT_RED="\[\033[1;31m\]" | |
DULL_WHITE="\[\033[0;37m\]" | |
BRIGHT_WHITE="\[\033[1;37m\]" | |
PS1="${DULL_WHITE}\w${BRIGHT_RED} \$(parse_git_branch)${BRIGHT_WHITE}\$ " |
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
#!/bin/sh -x | |
# repull: Merge the latest changes from the master branch into your current branch | |
function repull { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || exit 0 | |
CURRENT="${ref#refs/heads/}" | |
git checkout master | |
git pull origin master | |
git checkout ${CURRENT} | |
git rebase master | |
} |
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
POST /user_sessions.json { "email": "[email protected]", "password": "somepassword" } | |
=> { "user_credentials": "123abc" } | |
GET /case_filters/1/cases.json?user_credentials=123abc | |
=> [ ...cases ... ] |
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
ruby-1.9.2-p180 :001 > p = Post.create | |
=> #<Post id: 1, title: nil, comments_count: 0, created_at: "2011-08-29 02:58:04", updated_at: "2011-08-29 02:58:04"> | |
ruby-1.9.2-p180 :002 > p.comments.create | |
=> #<Comment id: 1, title: nil, post_id: 1, created_at: "2011-08-29 02:58:16", updated_at: "2011-08-29 02:58:16"> | |
ruby-1.9.2-p180 :003 > p.comments.create | |
=> #<Comment id: 2, title: nil, post_id: 1, created_at: "2011-08-29 02:58:18", updated_at: "2011-08-29 02:58:18"> | |
ruby-1.9.2-p180 :004 > p.reload | |
=> #<Post id: 1, title: nil, comments_count: 2, created_at: "2011-08-29 02:58:04", updated_at: "2011-08-29 02:58:04"> | |
ruby-1.9.2-p180 :005 > Post.create | |
=> #<Post id: 2, title: nil, comments_count: 0, created_at: "2011-08-29 02:58:30", updated_at: "2011-08-29 02:58:30"> |
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
# Ruby example for exporting Cases to CSV | |
# requires ruby version 1.9.2 | |
# requires oauth and json gems (gem install oauth json) | |
require "rubygems" | |
require "oauth" | |
require "json" | |
require "csv" | |
ASSISTLY_DOMAIN = "domain.assistly.com" |
OlderNewer