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 validEmail(email){ | |
var emailReg = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; | |
return emailReg.test(email); | |
} |
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
# User specific aliases and functions | |
alias ll='ls -alF' | |
alias la='ls -A' | |
alias l='ls -CF' | |
alias rm='rm -i' | |
alias mv='mv -i' | |
alias du='du -h --max-depth=1' | |
alias df='df -h' | |
alias grep='grep --color' |
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
# Lines configured by zsh-newuser-install | |
HISTFILE=~/.histfile | |
HISTSIZE=512 | |
SAVEHIST=512 | |
bindkey -v | |
# End of lines configured by zsh-newuser-install | |
# The following lines were added by compinstall | |
zstyle :compinstall filename '/home/codeb2cc/.zshrc' | |
autoload -Uz compinit |
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 -*- | |
# MongoDB Benmarking with Mongoengine | |
import os, time, multiprocessing | |
import pymongo | |
import mongoengine | |
DB_HOST = '127.0.0.1' | |
DB_PORT = 27017 |
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 -*- | |
# This demo demonstrates the concurrency problem of MongDB's GridFS interface. | |
import os, tempfile, multiprocessing, time | |
import pymongo, gridfs | |
import mongoengine | |
DB_HOST = '127.0.0.1' | |
DB_PORT = 27017 |
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 -*- | |
# This demo demonstrates the concurrency problem of MongDB's GridFS interface. | |
import os, tempfile, multiprocessing, time | |
import pymongo, gridfs | |
import mongoengine | |
DB_HOST = '127.0.0.1' | |
DB_PORT = 27017 |
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 tempfile | |
import pymongo, gridfs, mongoengine | |
class TheDocument(mongoengine.Document): | |
the_file = mongoengine.FileField() | |
if __name__ == '__main__': |
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 -*- | |
from pprint import pprint | |
import pymongo, mongoengine | |
class TheDocument(mongoengine.Document): | |
field_a = mongoengine.StringField() | |
field_b = mongoengine.StringField() | |
field_c = mongoengine.StringField() |
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 () { | |
"use strict" | |
var doc = document | |
var head = doc.head || | |
doc.getElementsByTagName('head')[0] || | |
doc.documentElement | |
function scriptOnload(node, callback) { |
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
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --" |
OlderNewer