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
wget http://downloads.mongodb.org/linux/mong … -1.2.0.tgz | |
tar xvfz mongodb-linux-i686-1.2.0.tgz -C /usr/local/softnix/ | |
mv mongodb-linux-i686-1.2.0/ mongodb | |
mkdir -p /data/db | |
ln -s /usr/local/softnix/mongodb/bin/mongod /sbin/mongod | |
ln -s /usr/local/softnix/mongodb/bin/mongo /bin/mongo | |
./mongod & | |
./mongo |
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 ruby | |
# This script is a backup tool for mongodb. | |
# | |
# The main purpose is to dump files from gridfs to filesystem, | |
# to take advantage of backup solutions based on tools like | |
# rsync. | |
# Developed against mongo 1.6.0 |
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
/* new clearfix */ | |
/* http://perishablepress.com/press/2009/12/06/new-clearfix-hack/ */ | |
.clearfix:after { | |
visibility: hidden; | |
display: block; | |
font-size: 0; | |
content: " "; | |
clear: both; | |
height: 0; | |
} |
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
111 o.......在已有窗口中打开文件、目录或书签,并跳到该窗口 .....|NERDTree-o| | |
112 go......在已有窗口中打开文件、目录或书签,但不跳到该窗口 .....|NERDTree-go| | |
113 t.......在新Tab中打开选中文件/书签,并跳到新Tab .....|NERDTree-t| | |
114 T.......在新Tab中打开选中文件/书签,但不跳到新Tab .....|NERDTree-T| | |
115 i.......split一个新窗口打开选中文件,并跳到该窗口 .....|NERDTree-i| | |
116 gi......split一个新窗口打开选中文件,但不跳到该窗口 .....|NERDTree-gi| | |
117 s.......vsp一个新窗口打开选中文件,并跳到该窗口 .....|NERDTree-s| | |
118 gs......vsp一个新窗口打开选中文件,但不跳到该窗口 .....|NERDTree-gs| | |
119 !.......执行当前文件 .....|NERDTree-!| | |
120 O.......递归打开选中结点下的所有目录 .....|NERDTree-O| |
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/bash | |
echo "Updating Packages..." | |
apt-get -qq -y update | |
echo "Installing Vim..." | |
apt-get -qq -y install vim-gnome | |
echo "Installing Utilities..." | |
apt-get -qq -y install curl bison build-essential zlib1g-dev libssl-dev libreadline5-dev libxml2-dev |
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 bash | |
echo "Fixing Samba..." | |
echo "[default]" > ~/Library/Preferences/nsmb.conf | |
echo "streams=no" >> ~/Library/Preferences/nsmb.conf | |
echo "Removing System Gems..." | |
rm -r /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8 | |
gem update --system | |
gem clean |
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 User | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
include Mongoid::Document::ProtectedAttributes | |
attr_protected :password_hash, :password_salt | |
attr_accessor :password, :password_confirmation | |
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 UsersController < ApplicationController | |
def new | |
@user = User.new | |
end | |
def create | |
@user = User.new(params[:user]) | |
if @user.save | |
flash[:notice] = "Thank you for signing up! please activate your account using the link we just sent to your email address." | |
redirect_to root_url |
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
def rand_array(arr) | |
rand_arr = [] | |
temp_arr = [] | |
s = arr.size-1 | |
for i in 0..s | |
r=rand(s+1) | |
if temp_arr[r] != 1 | |
rand_arr.push(arr[r]) | |
temp_arr[r] = 1 |