This file contains 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
Autodoc.configuration.template = <<-EOF | |
## <%= method %> <%= path %> | |
<%= description %> | |
<%= parameters_section %> | |
### request | |
``` | |
<%= method %> <%= path %> | |
``` | |
<%= request_body_section %> | |
### response |
This file contains 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
diff --git a/spec/functional/embedded_document_spec.rb b/spec/functional/embedded_document_spec.rb | |
index 22112d5..166eefe 100644 | |
--- a/spec/functional/embedded_document_spec.rb | |
+++ b/spec/functional/embedded_document_spec.rb | |
@@ -9,6 +9,7 @@ describe "EmbeddedDocument" do | |
@pet_klass = EDoc('Pet') do | |
key :name, String | |
+ key :flag, Boolean | |
end |
This file contains 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
feature_branch() { | |
if [ "${1}" = "" ]; then | |
echo "${0} <new feature branch name>" | |
return | |
fi | |
branch_name="`date '+%d%m%y'`_${1}" | |
git co -b ${branch_name} master | |
git push | |
git branch --set-upstream ${branch_name} origin/${branch_name} |
This file contains 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
--- bulkloader.py.org 2011-05-22 02:27:56.000000000 +0100 | |
+++ bulkloader.py 2011-05-22 02:21:17.000000000 +0100 | |
@@ -3121,7 +3121,7 @@ | |
""" | |
self.app_id = arg_dict['application'] | |
self.post_url = arg_dict['url'] | |
- self.kind = arg_dict['kind'] | |
+ self.kind = ParseKind(arg_dict['kind']) | |
self.batch_size = arg_dict['batch_size'] | |
self.input_generator_factory = input_generator_factory |
This file contains 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 LoggerMiddleware(object): | |
def __init__(self, app): | |
self.app = app | |
def __call__(self, env, start_response): | |
request = webapp.Request(env) | |
if request.body: | |
logging.info(request.body) | |
return self.app(env, start_response) |
This file contains 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
# encoding: utf-8 | |
module Mongoid #:nodoc: | |
# Include this module to add automatic sequence feature | |
# usage: | |
# Class KlassName | |
# include Mongoid::Document | |
# include Mongoid::Sequence | |
# ... | |
# field :number, :type=>Integer | |
# sequence :number |
This file contains 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
SELECT d.nspname, b.relname, h.attname FROM pg_class b | |
JOIN pg_namespace d ON b.relnamespace=d.oid | |
join pg_attribute h on (b.oid=h.attrelid) | |
where b.relkind='r' and h.attname like '%_id' | |
and not exists (select true from pg_constraint e | |
join pg_class f on (f.oid=e.conrelid) where e.conrelid = b.oid and e.contype='f') and h.attnum > 0 | |
and d.nspname not in ('pg_catalog', 'information_schema'); |
This file contains 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
doc1: {"num": [3, 10, 25], "type": "A"} | |
doc2: {"num": [1, 2, 3, 5], "type": "B"} | |
doc3: {"num": [5, 6, 7, 1], "type": "A"} | |
At the moment, i can do that something like: | |
db.something.find({"type": "A"}, {"num": 1}) | |
I get something like: | |
"num": [5, 6, 7, 1] | |
"num": [3, 10, 25] |
This file contains 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 | |
# resque_scheduler wrapper for monit | |
# see also http://mmonit.com/wiki/Monit/FAQ#pidfile | |
usage() | |
{ | |
echo "usage: ${0} {start|stop}" | |
exit 1 | |
} |
This file contains 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
check process resque-scheduler with pidfile /usr/local/app/APPLICATION/shared/pids/resque_scheduler.pid | |
group resque_scheduler | |
start program = "/usr/local/app/APPLICATION/current/script/resque_scheduler start" | |
stop program = "/usr/local/app/APPLICATION/current/script/resque_scheduler stop" |