Skip to content

Instantly share code, notes, and snippets.

View c4pt0r's full-sized avatar

dongxu c4pt0r

View GitHub Profile
#encoding=utf-8
import os
import sys
import StringIO
import json
def get_file_content(path_to_sln):
with open(path_to_sln) as fp:
content = fp.read()
return content
return None
@c4pt0r
c4pt0r / script.py
Created August 6, 2013 01:12
vcproj denpendency walker
#encoding=utf-8
import os
import sys
import StringIO
import json
def get_file_content(path_to_sln):
with open(path_to_sln) as fp:
content = fp.read()
return content
return None
@c4pt0r
c4pt0r / engine_downloader.cpp
Created October 19, 2013 07:04
Downloader Draft
// Copyright (c) 2013 The Wandoujia Authors. All rights reserved.
#ifndef PLATFORM_WDJ_CONNECTION_WRAPPER_WDJ_CONNECTION_DOWNLOADER_H_
#define PLATFORM_WDJ_CONNECTION_WRAPPER_WDJ_CONNECTION_DOWNLOADER_H_
#include <windows.h>
#include <map>
#include "net/win_http.h"
//
class EngineDownloader: async_wininet::WinHTTPListener {
public:
static EngineDownloader* GetInstance();
@c4pt0r
c4pt0r / fan.py
Created October 21, 2013 04:49
hacker need food!!!!
#!/usr/bin/env python
#encoding=utf-8
# Hacker Need Food!
import json
import os
import sys
from optparse import OptionParser
import urllib, urllib2, cookielib
import os
import sys
import tornado.web
import tornado.ioloop
import json
import random, string
raw_file_path = None
meta_data_path = None
package main
import (
"code.google.com/p/leveldb-go/leveldb/db"
"code.google.com/p/leveldb-go/leveldb/table"
"fmt"
"runtime"
)
type kv struct {
步骤一,将你准备好的U盘或移动硬盘或分区(大于等于6G),用磁盘工具格式化成Mac OS扩展(日志式)格式,名称输入“Mavericks”,并创建
步骤二,从Mac App Store下载安装程序。(或任何地方获得的安装程序)
步骤三,请先确认安装程序在应用程序文件夹里。(重要:如下载的是镜像,请挂载后将安装程序复制到应用程序文件夹里。)
步骤四,打开终端,输入以下代码,后输入密码确认(密码不会显示):
sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Mavericks --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction
复制代码
// Check is current MAC OS X version less than supportedVersion
function checkForMacOSX(supportedVersion) {
try {
// Get current ProductVersion
var tProductVersion = system.version.ProductVersion;
// Get current ProductName
var tProductName = system.version.ProductName;
// Check if current version is less than supportedVersion, if yes Set the result type to Fatal, and give correct message to user
<!doctype html>
<html lang="en">
<head>
<style>
body {
font-family: 'Georgia', serif;
font-size: 17px;
color: #000;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <png.h>
#include <webp/encode.h>
#include <webp/mux.h>
static void PNGAPI error_function(png_structp png, png_const_charp dummy) {