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 | |
if [[ -f /Applications/MacVim.app/Contents/MacOS/Vim ]] | |
then | |
# bypass mvim for speed | |
VIMPATH='/Applications/MacVim.app/Contents/MacOS/Vim -g -dO -f' | |
elif [[ -f /usr/local/bin/mvim ]] | |
then | |
# fall back to mvim | |
VIMPATH='mvim -d -f' | |
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
@echo off | |
set regpath=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment | |
set javahome=C:\Program Files\Java\jdk1.6.0_10 | |
rem LPY | |
echo. | |
echo ************************************************************ | |
echo * * | |
echo * JDK 系统环境变量设置 * | |
echo * * | |
echo ************************************************************ |
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 tornado.log import enable_pretty_logging | |
enable_pretty_logging() |
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 -g prefix C-a | |
set-window-option -g mode-keys vi | |
set-window-option -g utf8 on | |
set -g mode-mouse on | |
set -g mouse-select-pane on | |
set -g mouse-resize-pane on | |
set -g mouse-select-window on |
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
#coding: utf-8 | |
from PyQt4.QtGui import * | |
from PyQt4.QtCore import * | |
import sys | |
QTextCodec.setCodecForTr(QTextCodec.codecForName("utf8")) | |
class StandardDialog(QDialog): | |
def __init__(self,parent=None): |
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 clr | |
clr.AddReference('System.Data') | |
from System.Data.SqlClient import SqlConnection, SqlParameter | |
conn_string = 'data source=<machine>; initial catalog=<database>; trusted_connection=True' | |
connection = SqlConnection(conn_string) | |
connection.Open() | |
command = connection.CreateCommand() | |
command.CommandText = 'select id, name from people where group_id = @group_id' | |
command.Parameters.Add(SqlParameter('group_id', 23)) |
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 posixpath | |
import urllib | |
import socket | |
import BaseHTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
ROUTES = ( | |
['', '/Users/neil/workspaces/www-data/'], | |
) |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>无标题文档</title> | |
<style> | |
* { | |
margin:0; | |
padding: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
#****************************************************************************** | |
# Copyright (c) 2011 Trevor Harwell | |
# All rights reserved. This program and the accompanying materials | |
# are made available under the terms of the Eclipse Public License v1.0 | |
# which accompanies this distribution, and is available at | |
# http://www.eclipse.org/legal/epl-v10.html | |
# | |
# Contributors: | |
# Trevor Harwell - initial implementations | |
#****************************************************************************** |
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
# vim: ts=4: noexpandtab | |
import re | |
import sys | |
import select | |
import socket | |
import requests | |
import urlparse | |
import pybonjour | |
import urllib | |
import string |