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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
sudo yum update -y | |
sudo yum groupinstall -y 'development tools' | |
sudo yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel xz-libs wget | |
sudo wget http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz | |
tar xvf Python-2.7.8 | |
cd Python-2.7.8 | |
sudo ./configure --prefix=/usr/local | |
sudo make | |
sudo make altinstall | |
sudo wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py |
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
conn = pymssql.connect(server, user, password, "tempdb") | |
cursor = conn.cursor() | |
cursor.execute('SELECT * FROM persons WHERE salesrep=%s', 'John Doe') | |
for row in cursor: | |
print('row = %r' % (row,)) | |
conn.close() |
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
/** | |
* Modify the parts you need to get it working. | |
*/ | |
var should = require('should'); | |
var request = require('../node_modules/request'); | |
var io = require('socket.io-client'); | |
var serverUrl = 'http://localhost'; |
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 os | |
import logging | |
import codecs | |
import yaml | |
# config the logging | |
current_folder = os.path.dirname(os.path.realpath(__file__)) | |
logging_config_filename = os.path.join(current_folder, 'python_logging_example.yaml') | |
logging.config.dictConfig(yaml.load(codecs.open(logging_config_filename, 'r', 'utf-8'))) | |
logger = logging.getLogger('commonLog') |
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
# Tox (http://tox.testrun.org/) is a tool for running tests | |
# in multiple virtualenvs. This configuration file will run the | |
# test suite on all supported python versions. To use it, "pip install tox" | |
# and then run "tox" from this directory. | |
[tox] | |
skipsdist = 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>KISSY MINI Mobile Demo Template</title> | |
<!-- | |
width=device-width:让文档的宽度与设备的宽度保持一致,且文档最大的宽度比例是1.0 | |
initial-scale=1:初始的缩放比例 | |
maximum-scale=1:允许用户缩放到的最大比例(对应还有个minimum-scale) | |
user-scalable=no:不允许用户手动缩放 |
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
(function(priority) {console.log(priority); return priority && + priority | 0 || 0; })() | |
// undefined | |
// 0 | |
(function(priority) {console.log(priority); return priority && + priority | 0 || 0; })(45) | |
// 45 | |
// 45 | |
(function(priority) {console.log(priority); return priority && + priority | 0 || 0; })('a') | |
// a |
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
# Become root first ! | |
$ mkdir /etc/ssl/self-signed && cd /etc/ssl/self-signed | |
$ openssl genrsa -des3 -out server.key 1024 | |
$ openssl rsa -in server.key -out server.key.insecure | |
$ mv server.key server.key.secure && mv server.key.insecure server.key | |
$ openssl req -new -key server.key -out server.csr | |
$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt |
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
using System; | |
using System.Data; | |
using System.Configuration; | |
using System.Collections; | |
using System.Web; | |
using System.Web.Security; | |
using System.Web.UI; | |
using System.Web.UI.WebControls; | |
using System.Web.UI.WebControls.WebParts; | |
using System.Web.UI.HtmlControls; |
OlderNewer