Skip to content

Instantly share code, notes, and snippets.

View littilewing's full-sized avatar

littlewing littilewing

View GitHub Profile
from xml.etree.ElementTree import Element, SubElement, Comment, tostring
top = Element('detect')
child = SubElement(top, 'file')
child.text = 'file.jpg'
child_with_tail = SubElement(top, 'target')
child_with_tail.text = 'bbb.jpg'
print tostring(top)
# rigfy_Adjusts2Unity.py
# @Author: http://littlewing.hatenablog.com/
# @see http://community.cgcookie.com/t/blender-rigify-to-unity-mecanim-workflow/90
import re
import bpy
def setParent(nm_child,nm_parent,connected = False,both = True):
if(both):
setParent(nm_child + ".L",nm_parent + ".L",connected,False)
@littilewing
littilewing / UnipadESP8266_OSCSample.ino
Last active August 3, 2016 01:41
Unipad Example. this scripts need OSC library -> https://github.com/CNMAT/OSC
/////////////////////////////
//
// Unipad x ESP8266
// http://unipad.digitalray.co.jp
//
/////////////////////////////
//[how to use]
//
// 1. Download Unipad on your smartphone
// http://unipad.digitalray.co.jp/download/
point_id pointname office_id latitude longitude suikei_name kasen_name address rank_1 rank_2 rank_3 rank_4
7 本郷橋 43 34.6942 138.9396 稲生沢川水系 稲生沢川 下田市高馬 200 300 -999999999 390
8 峰大橋 43 34.7689 138.9728 河津川水系 河津川 賀茂郡河津町峰 150 250 310 330
9 伏倉橋 43 34.7543 138.7916 那賀川水系 那賀川 賀茂郡松崎町桜田 70 170 180 190
10 前原橋 43 34.6533 138.8572 青野川水系 青野川 賀茂郡南伊豆町下賀茂 160 180 260 310
17 築地橋 43 34.7709 138.7826 仁科川水系 仁科川 賀茂郡西伊豆町仁科 170 210 220 290
18 深根橋 43 34.7216 138.9342 稲生沢川水系 稲生沢川 下田市箕作 150 260 -999999999 430
20 宇久須 43 34.8473 138.7876 宇久須川水系 宇久須川 賀茂郡西伊豆町宇久須 100 200 -999999999 -999999999
107 白川橋 42 34.9277 139.059 伊東大川水系 伊東大川 伊東市荻 672 675 -999999999 -999999999
108 大川 42 34.9458 139.081 伊東大川水系 伊東大川 伊東市鎌田 720 770 -999999999 -999999999
@littilewing
littilewing / NanoBoardScratchHayashi.ino
Last active April 26, 2016 15:02
抵抗値を強制的に 0 or 100に固定
/*
NanoBoard
For DARUMA-san GA KORONDA !!!!
NanoBoardAG V1.4 7 May, 2015
by tiisai.dip.jp
#include <NewPing.h>
#define TRIGGER_PIN 11 // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN 15 // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 108 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
#define ResistanceA 1
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[RequireComponent(typeof(AudioSource))] //AudioSourceは必須.
[DisallowMultipleComponent] //複数アタッチさせない.
public class DeviceSensors : MonoBehaviour {
@littilewing
littilewing / jacktest.py
Last active February 18, 2016 06:19
song select function added.
# -*- coding: utf-8 -*-
# Attach to auto start
# add hayashi 160213
# /etc/rc.local
# sudo python /home/pi/Documents/docomo/jack.py > /dev/null 2>&1 &
import RPi.GPIO as GPIO
import time
import os
@littilewing
littilewing / OSCHostConroller.cs
Last active February 10, 2016 03:15
OSCHostConroller.cs.20160210-stable チャンネルの混線を修正
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Text;
#if !UNITY_WEBGL
using UnityOSC;
#else
using MiniJSON;
@littilewing
littilewing / xMultiInputs.cs
Last active August 4, 2016 00:54
xMultiInputs.cs.160803 ver1.4 keymaps + UWP support
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Net;
public enum xInputType{
OFF,GAMEPAD,TOUCHPAD,GYROPAD,GYROATTITUDE,FULLPAD
}
public enum xInputSensor{