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
#!/usr/bin/env python | |
#-*-coding="utf-8"-*- | |
#import MySQLdb | |
import httplib | |
import urllib | |
import simplejson | |
import time | |
import os | |
def papa(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
/*! | |
* Connect - logger | |
* Copyright(c) 2010 Sencha Inc. | |
* Copyright(c) 2011 TJ Holowaychuk | |
* MIT Licensed | |
*/ | |
/** | |
* Module dependencies. | |
*/ |
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
#!/usr/bin/env python | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
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
def check_palin(lister): | |
if len(lister) <= 1 : | |
print 'True' | |
return True | |
else: | |
if lister[0] == lister[-1]: | |
lister.pop() | |
del lister[0] | |
check_palin(lister) | |
else: |
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
#!/bin/bash | |
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin | |
export PATH | |
# Check if user is root | |
if [ $(id -u) != "0" ]; then | |
printf "Error: You must be root to run this script!\n" | |
exit 1 | |
fi |
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
#! /usr/bin/env python | |
# Released to the public domain, by Tim Peters, 03 October 2000. | |
"""reindent [-d][-r][-v] [ path ... ] | |
-d (--dryrun) Dry run. Analyze, but don't make any changes to, files. | |
-r (--recurse) Recurse. Search for all .py files in subdirectories too. | |
-n (--nobackup) No backup. Does not make a ".bak" file before reindenting. | |
-v (--verbose) Verbose. Print informative msgs; else no output. |
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 http = require('http'); | |
var mongodb = require('mongodb'); | |
var poolModule = require('generic-pool'); | |
var pool = poolModule.Pool({ | |
name: 'mongodb', | |
create: function(callback) { | |
mongodb.MongoClient.connect('mongodb://localhost/test', {server: {poolSize: 1}}, function(err, db) { | |
callback(err, db); | |
}); |
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 unittest, os, os.path, sys, urllib | |
import tornado.database | |
import tornado.options | |
from tornado.options import options | |
from tornado.testing import AsyncHTTPTestCase | |
# add application root to sys.path | |
APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) | |
sys.path.append(os.path.join(APP_ROOT, '..')) |
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
#!/bin/env python | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.options | |
import tornado.web | |
import tornado.httpclient | |
import tornado.gen | |
from tornado.concurrent import run_on_executor | |
#if < python3.2 you need do `sudo pip install futures` |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
# | |
# Author : Rhapsodyzs | |
# E-mail : zs1213yh@gmail.com | |
# Date : 14/01/08 11:01:17 | |
# Desc : | |
# | |
import MySQLdb | |
import random |
OlderNewer