Skip to content

Instantly share code, notes, and snippets.

View ExportTerrain.cs
// Converted from UnityScript to C# at - by Mike Hergaarden
// C # manual conversion work by Yun Kyu Choi
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
using System.IO;
using System.Text;
cnsoft /
Last active August 29, 2015 14:15 — forked from coryalder/

Save books out of Safari Books Online


This is hard. I spent way too much time figuring this out, because I was annoyed that a book I bought (Addison-Wesley) was available online for free, except only for 45 days after which payment was required. So I made this hack... probably useful to no one else, but here it is.


  1. iPad.
  2. Safari To Go (the Safari Books Online iPad app).
cnsoft /
Created May 26, 2014 14:53
export some item from one json file to new file.
import json
import codecs
#open the source file
json_file = open('map.txt','r')
data =
datas = json.loads(data.decode("utf-8" ) )
#data1 = json.loads('utf-8') )
# data.decode("utf-8-sig"))
#print data
View worker nginx conf
location /video/ {
if ($request_uri ~ "^/video/(.+?)/.+") {
set $upstream_host $;
add_header Content-Disposition "attachment; filename=video.mp4;";
rewrite /video/.+?/(.+)$ /$1 break;
proxy_buffering off;
proxy_pass https://$upstream_host;
proxy_set_header Host $upstream_host;
View haproxy.conf
# This config file is a combination of ideas from:
# This code generates heat maps. Given a list of 2D positions and a background image, this code
# generates clusters of positions, colors them by intensity, and blends them with the background
# image.
# This code has the following dependencies:
# * spot.png - A radial gradient used to mark individual heat points.
# * colors.png - An image describing the range of colors to map to heat intensity.
cnsoft /
Created February 20, 2014 03:41 — forked from schnabear/
while read link; do if [ ! -f "$(basename $link)" ]; then wget $link; fi; done < GDMAG.txt
cnsoft / unity3d_360sdk.txt
Created February 11, 2014 09:57
unity3d + 360
View unity3d_360sdk.txt
官方的文档看的有点迷糊, 我现在u3d android 编译OK,在Temp->StagingArea有android的编译后的android相关的文件, 然后是在eclipse下新建个android的工程保持与unity3d相关设置一样,把360sdk jar包和unity3d class.jar导入到新建工程lib里吗? 然后编译成jar包再导入unity3d工程里??? 就说流程是否如同unity3d 接91 sdk for android差不多? 回帖推荐 紫夜行者 查看楼层 1.修改Android工程和Unity工程,保持包名、版本一致。设置Company Name、ProductName等。 Q: 此android工程是自己新建的工程,保持包名,版本一致?还是unity3d 编译后在temp->StagingArea临时生成android工程,直接eclipse导入该工程? 2.复制Unity类库到Android工程,编译Android工程,导入jar包到Unity工程\Assets\Plugins\Android\bin下 Q: 是将u3d bin下 class.jar 和 plugins 下所有jar包导入到android工程? 3.后面直 ...
cnsoft / adRemoved.txt
Created February 11, 2014 08:29
Disable youku tudou xunlei's ad before view video.
View adRemoved.txt
#去优酷网广告 localhost
View gist:8862054
#go to folder:
/Applications/Adobe Photoshop CS6/Locales/pt_BR/Support Files/tw10428.dat
#rename the file tw10428.dat for tw10428.bak