Skip to content

Instantly share code, notes, and snippets.

@yin8086
yin8086 / notepadRemoveLine.md
Created November 13, 2016 14:46
notepad++ remove odd even lines regex

notepad++ remove odd even lines regex

# remove even lines
([^\r\n]*\R)[^\r\n]*\R?
\1
# remove odd lines
@yin8086
yin8086 / aegisub_note_chinese.md
Created May 22, 2016 14:14
Aegisub32 Lua Script学习笔记(官方文档翻译总结)

Aegisub32 Lua Script学习

@(日常笔记)

一、整体结构

1. 全局变量——描述脚本元数据

  • script_name
  • script_description
  • script_author
  • script_version
@yin8086
yin8086 / aegisub32_note_Chinese.md
Created May 22, 2016 14:13
Aegisub32 Lua Script学习笔记(官方文档翻译总结)

Aegisub32 Lua Script学习

一、整体结构

1. 全局变量——描述脚本元数据

  • script_name
  • script_description
  • script_author
  • script_version

2. 脚本功能——均可包含0个一个或者多个

@yin8086
yin8086 / PrintUnity3dType.cs
Created April 22, 2016 03:25
Unity3d Texture Type Descriptions.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestUnityConsole
{
class Program
{
@yin8086
yin8086 / etc2_export.py
Created March 8, 2016 18:23
arm etc2(Ericsson Texture Compression, Unity asset) to png, and png to etc2, use official `etcpack.exe` from [Mali GPU Texture Compression Tool](http://malideveloper.arm.com/resources/tools/mali-gpu-texture-compression-tool/)
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 07 00:55:12 2016
@author: Stardrad
"""
import os, struct, fnmatch, time
from PIL import Image
@yin8086
yin8086 / astc_export.py
Last active November 18, 2023 03:31
arm astc(Adaptive Scalable Texture Compression, Unity asset) to png, and png to astc, use official `astcenc.exe`
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 15 15:53:10 2015
@author: Stardrad
astcenc.exe: https://www.dropbox.com/s/u5w6d972nniursu/ASTC-Evaluation-Codec-1.3.zip?dl=0
"""
import os, struct, fnmatch, time, math
@yin8086
yin8086 / ImageExport.py
Last active November 18, 2023 03:49
SeitokaiNoichizonLv2_Crack
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 16 10:07:25 2014
@author: Stardrad
"""
import time, struct, os, fnmatch
from cStringIO import StringIO
import gzip
@yin8086
yin8086 / mimetypes.py
Created October 15, 2014 02:44
Modify the ipython notebook error in Python
# Python27/Lib/mimetypes.py
# Line 248
# Original Line, comment the following lines
def enum_types(mimedb):
i = 0
while True:
try:
@yin8086
yin8086 / pysquish.cpp
Created October 1, 2014 09:59
PySquish
// Squish bindings for python
// http://stackoverflow.com/questions/10972595/dxt-compression-for-python
// modify Stardrad
#include <squish.h>
#include "pysquish.h"
extern "C" {
void CompressMasked(u8 const* rgba, int mask, void* block, int flags) {
@yin8086
yin8086 / fixPMF.py
Created July 11, 2013 02:28
Use {filename:time} dictionary fix the timestamp in pmf file
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 11 09:50:16 2013
@author: Stardrad Yin
"""
import os, fnmatch, struct
timeDic = {'mv00':89, 'mv04':67, 'mv05':102, 'mv06':29, 'mv07':27,\
'mv08':34, 'mv10':21, 'mv12':21}