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
var mongoose = require('mongoose') | |
, Schema = mongoose.Schema | |
mongoose.connect('localhost', 'testing_tojsonWithVirtuals'); | |
var PersonSchema = new Schema({ | |
name : String | |
, age : Number | |
}); |
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
#!/usr/bin/env python | |
import sys | |
import os | |
if __name__ == '__main__': | |
module = __import__(sys.argv[1]) | |
path = module.__file__.replace('.pyc', '.py') | |
if os.path.basename(path) == '__init__.py': | |
path = os.path.dirname(path) | |
print 'Opening "%s"' % path |
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
# -*- coding: utf-8 -*- | |
import os | |
import re | |
import datetime | |
from ftplib import FTP | |
from BeautifulSoup import BeautifulSoup | |
_multilines_re = re.compile(r'<([a-z0-9\-]+)\s+(.*?)\s+</\1>', re.S | re.M) | |
_singleline_re = re.compile(r'<(product|version)>\s+(.+)$', re.M) |
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
letters = ['A', 'B', 'C'] | |
nb_letters = len(letters) | |
total = 100 | |
step = total / nb_letters | |
index = 0 | |
results = [] | |
for i in range(1, total + 1): | |
if index == nb_letters: | |
index -= 1 |
NewerOlder