全部已出
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=gbk | |
import glob, tmxlib, os, base64 | |
""" | |
生成空地图,添加所有物件和地表 | |
""" | |
from tmxlib.fileio import * | |
class MySerializer(TMXSerializer): | |
def image_to_element(self, image, base_path): | |
if image.source is None: | |
element = etree.Element('image', attrib=dict(format='png')) |
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
drop database if exists game; | |
drop database if exists info; | |
create database game default charset utf8; | |
create database info default charset utf8; | |
create user 'game'@'localhost' identified by 'game'; | |
create user 'game'@'%' identified by 'game'; | |
grant all privileges on game.* to 'game'@'localhost'; | |
grant all privileges on game.* to 'game'@'%'; |
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
for /R %f in (*.cpp;*.c;*.h) do c:\tools\astyle -p -U --style=ansi "%f" | |
来自:http://blog.csdn.net/memory_xj/article/details/2983093 |
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 | |
@reg copy HKLM\HARDWARE\ACPI\DSDT\VBOX__ HKLM\HARDWARE\ACPI\DSDT\NOBOX__ /s /f | |
@reg delete HKLM\HARDWARE\ACPI\DSDT\VBOX__ /f | |
@reg add HKLM\HARDWARE\DESCRIPTION\System /v SystemBiosVersion /t REG_MULTI_SZ /d "NOBOX - 1" /f | |
@exit |
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 apt-get install python-software-properties | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java7-installer | |
To automatically set up the Java 7 environment variables JAVA_HOME and PATH: | |
sudo apt-get install oracle-java7-set-default |
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/sh | |
PROJECT_ROOT="$(pwd)/pvzsequel/proj.ios" | |
WORKSPACE="$PROJECT_ROOT/pvzsequel.xcodeproj/project.xcworkspace" | |
CONFIG="Release" | |
SCHEME="pvzsequel" | |
SDK="iphoneos" | |
TARGET="pvzsequel" | |
BUILDDIR="$PROJECT_ROOT/build" | |
OUTPUTDIR="$BUILDDIR/Release-$SDK" |
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
@contextlib.contextmanager | |
def working_directory(path): | |
""" | |
A context manager which changes the working directory to the given | |
path, and then changes it back to its previous value on exit. | |
Original by Greg Warner: | |
http://code.activestate.com/recipes/576620-changedirectory-context-manager/#c3 | |
""" | |
prev_cwd = os.getcwd() | |
os.chdir(path) |
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 | |
import requests | |
import re | |
from bs4 import BeautifulSoup | |
from subprocess import call, check_output | |
import string | |
def fetch_html(links): |