Skip to content

Instantly share code, notes, and snippets.

View asus4's full-sized avatar
:octocat:
Working from home

Koki Ibukuro asus4

:octocat:
Working from home
View GitHub Profile
@asus4
asus4 / print_webcam_spec.py
Last active November 27, 2017 11:23
Print webcam spec using v4l2 command
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Tag auth """
from __future__ import print_function
import commands
import re
def v4l2_ctl(options):
@asus4
asus4 / BarcodeScanner.cs
Last active November 21, 2022 09:44
USB BarcodeScanner input on Unity3D
using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
namespace AppKit
{
/// <summary>
/// Barcode Scanner Input
///
@asus4
asus4 / fild_files.py
Created May 30, 2017 15:17
Find specific extension files in directory (python)
def fild_files(directory, file_ext):
''' Find specific extension files in the folder '''
for root, dirs, files in os.walk(directory):
for file in files:
_, ext = os.path.splitext(file)
if ext == '.' + file_ext:
yield os.path.join(root, file)
@asus4
asus4 / PathViewController.swift
Created May 29, 2017 13:53
Sample for KML.swift
//
// PathViewController.swift
// Kml
//
// Created by Koki Ibukuro on 8/18/15.
// Copyright (c) 2015 asus4. All rights reserved.
//
import UIKit
import MapKit
@asus4
asus4 / ota-upload-esp32.sh
Last active March 12, 2020 07:42
PlatformIO / OTA upload / ESP32 - arduiono
#!/bin/bash
set -e
espota=~/.platformio/packages/framework-arduinoespressif32/tools/espota.py
espip=YOUR_ESP_HOSTNAME.local
bin_file=.pioenvs/esp32dev/firmware.bin
# build and upload
platformio run -e esp32dev
$espota -i $espip -p 3232 -r -f $bin_file
@asus4
asus4 / tracking.py
Created May 15, 2017 08:39
OpenCv3 Tracking API on Python3
# coding:utf-8
# pylint: disable=C0111,C0103,E0401
import time
import cv2 as cv
class App(object):
def __init__(self, algorithm):
@asus4
asus4 / VideoSupportPlugin.java
Last active March 12, 2017 01:10
Check supported resolution from unity
package asus4.videosupportedplugin;
import android.media.MediaCodecInfo;
import android.media.MediaCodecList;
/**
* Created by ibu on 2017/03/12.
*/
public final class VideoSupportedPlugin {
@asus4
asus4 / name.sh
Created February 16, 2017 04:30
名前占いの画像をダウンロードする!
#!/bin/bash
if [ $# -ne 2 ]; then
echo "option is ./namae.sh 性 名" 1>&2
exit 1
fi
echo "downloading $1 $2"
curl "https://enamae.net/download.php?sei=$1&mei=$2" > "$1$2.jpg"
@asus4
asus4 / restart-bluetooth.sh
Created December 28, 2016 12:52
Restart bluetooth from Alfred ( require https://github.com/toy/blueutil )
/usr/local/bin/blueutil power 0
sleep 1
/usr/local/bin/blueutil power 1
osascript -e 'display notification "Restarted" with title "Bluetooth" '
@asus4
asus4 / LPF.cs
Created December 2, 2016 14:19
Simple low pass filter (Unity support)
using System;
// Port from c++
// https://gist.github.com/asus4/1ec57e68ba9fa1363a6f
public class LPF
{
double[] ax = new double[3];
double[] by = new double[3];
double[] xv = new double[3];