Skip to content

Instantly share code, notes, and snippets.

View jerem's full-sized avatar

Jérémy Bethmont jerem

View GitHub Profile
@jerem
jerem / test.js
Created January 10, 2012 14:09
Mongoose toJSON
var mongoose = require('mongoose')
, Schema = mongoose.Schema
mongoose.connect('localhost', 'testing_tojsonWithVirtuals');
var PersonSchema = new Schema({
name : String
, age : Number
});
#!/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
# -*- 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)
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