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
# ---------------------------------------------------------------------- | |
# WARNING - do not edit this template unless you know what you are doing | |
# ---------------------------------------------------------------------- | |
# the parent cache | |
# disk and memory cache settings | |
cache_dir ufs /usr/local/squid/var/cache 500 16 256 #set your cache path with size |
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
import re | |
import requests | |
import urllib | |
import json | |
# MOVIE_NAME = 'The Other Dream Team' | |
BASE_URL = 'http://www.imdbapi.com/?' | |
NAME_LIST = file('movies.txt','r') |
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
'''A sample google search script,you have to install python module "google before running it"''' | |
import sys | |
import time | |
from google import search | |
def do(keyword,stop): | |
count = 0 | |
for url in search(keyword,lang='en',num=10,pause=3): | |
count +=1 | |
print url |
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
app = {}; | |
app.run = function run() { | |
//console.log('Running app...'); | |
app.init(); | |
} | |
app.init = function () { | |
//console.log('Running init...'); | |
app.bind(); | |
} |
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
var app = this.app || {}; | |
// Application Settings | |
app.settings = { | |
'ajax' : { | |
'timeout' : 50000, | |
'delay' : 0 | |
} | |
} |
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 Book(object): | |
@property | |
def title(self): | |
return self._title | |
@title.setter | |
def title(self, value): | |
if value is None or "" == value.strip(): | |
raise ValueError("Title should have proper value!") |
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
from itertools import izip | |
A = [1, 2] | |
B = [3, 4] | |
C = [5, 6] | |
def iterate_using_zip(item1, item2, item3): | |
for a,b,c in zip(item1, item2, item3): | |
print a,b,c |
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
set nocompatible | |
set number | |
set title | |
syntax on | |
set hlsearch | |
set ls=2 | |
set showmode |
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
alias p=pwd | |
alias l='ls -l' | |
alias webroot='cd /Library/WebServer/Documents' | |
alias php.ini='vim /private/etc/php.ini' | |
alias httpd.conf='sudo vim /etc/apache2/extra/httpd-vhosts.conf' | |
alias hosts='sudo vim /etc/hosts' | |
alias mongo-server='/Library/mongodb-osx-x86_64-1.8.1/bin/mongod' | |
alias mongo-client='/Library/mongodb-osx-x86_64-1.8.1/bin/mongo' | |
alias down='sudo halt' | |
alias apache='sudo /usr/sbin/apachectl restart' |
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
from __future__ import division | |
from math import sqrt, pow | |
class StandardDeviation(object): | |
def do_round(self, data): | |
data = "%.3f" % round(data, 3) | |
return float(data) | |
def do_diff(self, n, mean): |
OlderNewer