Skip to content

Instantly share code, notes, and snippets.

@findix
findix / Swoooosh.markdown
Created April 26, 2014 10:36
A Pen by Lawren.

Swoooosh

A bit of JS and CSS3 to make a stack of "needles" that eventually start spinning and cycling through the color wheel. You can play with the first variable to change the pattern and effects.

A Pen by Lawren on CodePen.

License.

@findix
findix / RecType.py
Last active August 29, 2015 14:00
自动识别文件类型修改拓展名
# -*- coding: utf-8 -*-
'''
author:凤翔
本工具可以根据文件头自动修改文件后缀名
'''
import os
# 设置目录
@findix
findix / Xls2txt.py
Created May 13, 2014 11:28
批量下载全校学生照片并按性别分类的不道德行为
# -*- coding: utf-8 -*-
import xlrd
resultFile = open("./info.txt", "w")
fname = "./info.save.xls"
data = xlrd.open_workbook(fname)
table = data.sheets()[0]
nrows = table.nrows
ncols = table.ncols
for i in range(nrows):
@findix
findix / getAllFileFromDir.py
Last active August 29, 2015 14:01
遍历目录获取所有文件
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import os.path
import shutil
#需要遍历的目录
fromDir='.\\'
#文件汇总到的目录
# -*- coding: utf-8 -*-
import os
def main():
for root, dirs, files in os.walk("."):
for f in files:
if ".meta" not in f:
print root.replace(".\\",""),f.split('.')[0]
if __name__ == '__main__':
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// A base class for creating editors that decorate Unity's built-in editor types.
/// </summary>
public abstract class DecoratorEditor : Editor
@findix
findix / EvilTransform
Created June 7, 2016 09:48
地球坐标系 -> 火星坐标系
//
// Copyright (C) 1000 - 9999 Somebody Anonymous
// NO WARRANTY OR GUARANTEE
//
using System;
namespace Navi
{
class EvilTransform
@findix
findix / LengthOfMP3.py
Created March 22, 2018 10:13
批量解析MP3文件时长
#!/bin/python
import os
from os.path import join
from mutagen.mp3 import MP3
def main():
root = r'/path/to/mp3_files'
csv = open("result.csv", 'w')
@findix
findix / audio_concat.py
Created March 26, 2018 04:03
使用ffmpeg批量拼接音频
import os
import subprocess
def main():
for root, dirs, files in os.walk("mp3", topdown=False):
for name in files:
print(name)
try:
out_bytes = subprocess.check_output(
@findix
findix / restore_samba_backup_sensor.yaml
Last active April 2, 2022 14:33
restore_samba_backup_sensor.yaml
blueprint:
name: Restore Samba Backup sensor on startup
description: Restore Samba Backup sensor on startup
domain: automation
input:
addon:
name: Samba Backup Addon
description: Select samba backup addon.
selector:
addon: