Skip to content

Instantly share code, notes, and snippets.

View ExportTerrain.cs
// Converted from UnityScript to C# at http://www.M2H.nl/files/js_to_c.php - 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;
View blogpost.md

Save books out of Safari Books Online

From http://objectivesea.tumblr.com/post/9033067018/safaribooks

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.

Requirements:

  1. iPad.
  2. Safari To Go (the Safari Books Online iPad app).
@cnsoft
cnsoft / json_export.py
Created May 26, 2014
export some item from one json file to new file.
View json_export.py
import json
import codecs
#open the source file
json_file = open('map.txt','r')
data = json_file.read()
datas = json.loads(data.decode("utf-8" ) )
#data1 = json.loads(json_file.read())#.decode('utf-8') )
# data.decode("utf-8-sig"))
#print data
View worker nginx conf
resolver 8.8.8.8;
location /video/ {
if ($request_uri ~ "^/video/(.+?)/.+") {
set $upstream_host $1.googlevideo.com;
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:
# http://www.37signals.com/svn/posts/1073-nuts-bolts-haproxy
# http://www.igvita.com/2008/05/13/load-balancing-qos-with-haproxy/
# http://wiki.railsmachine.com/HAProxy
# http://elwoodicious.com/2008/07/15/nginx-haproxy-thin-fastcgi-php5-load-balanced-rails-with-php-support/
# http://upstream-berlin.com/2008/01/09/using-haproxy-with-multiple-backends-aka-content-switching/
# http://wiki.railsmachine.com/HAProxy
# http://gist.github.com/raw/25482/d39fb332edf977602c183194a1cf5e9a0b5264f9
#
View heatmap.py
#!/usr/bin/python
#
# 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.
#
View DL.sh
#!/bin/bash
while read link; do if [ ! -f "$(basename $link)" ]; then wget $link; fi; done < GDMAG.txt
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.后面直 ...
http://bbs.360safe.com/thread-3375903-1-1.html
@cnsoft
cnsoft / adRemoved.txt
Created Feb 11, 2014
Disable youku tudou xunlei's ad before view video.
View adRemoved.txt
#去优酷网广告
127.0.0.1 localhost
0.0.0.0 stat.youku.com
0.0.0.0 static.lstat.youku.com
0.0.0.0 valb.atm.youku.com
0.0.0.0 valc.atm.youku.com
0.0.0.0 valf.atm.youku.com
0.0.0.0 valo.atm.youku.com
0.0.0.0 valp.atm.youku.com
0.0.0.0 vid.atm.youku.com
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