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 nltk | |
import random | |
class Categorizer(object): | |
def __init__(self, categories): | |
self.categories = categories | |
def prep_seed(self, content): | |
"""Convert seed content into nltk.Text""" | |
raw = nltk.clean_html(content) |
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
<?php | |
require_once 'googleplaces.class.php'; | |
$googlePlaces = new GooglePlaces(array( | |
'apiKey' => "YOUR_API_KEY" | |
)); | |
$query['query'] = "Burger in Berlin"; | |
$places = $googlePlaces->getLocationsByTextSearch($query); | |
$decoded_data = json_decode($places, true); |
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
from bottle import Bottle,response | |
def allow_cors(func): | |
""" this is a decorator which enable CORS for specified endpoint """ | |
def wrapper(*args, **kwargs): | |
response.headers['Access-Control-Allow-Origin'] = 'example.com' # * in case you want to be accessed via any website | |
return func(*args, **kwargs) | |
return wrapper | |
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 |
OlderNewer