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 / WindowFunction.cs
Created March 3, 2019 12:20
Custom implementation of Unity FFT Window Function
using UnityEngine;
namespace Fourier
{
public static class WindowFunction
{
// Implementation of Unity FFT Window Functions
// https://docs.unity3d.com/ScriptReference/FFTWindow.html
@asus4
asus4 / PCA9622.py
Created July 26, 2018 08:43
Control PCA9622 I2C LED Driver from Raspberry PI
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" PCA9622 """
from __future__ import print_function
import time
import smbus
@asus4
asus4 / BindSlider.cs
Created March 16, 2018 05:30
[Unity] Bind the slider value into a private float serialize field in any MonoBehaviour.
using System;
using System.Linq;
using System.Reflection;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace AppKit
{
[RequireComponent(typeof(Slider))]
@asus4
asus4 / BindSlider.cs
Created March 14, 2018 10:34
[Unity] Bind a slider UI value into any SerializeField, even private field.
using System;
using System.Linq;
using System.Reflection;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace AppKit
{
[RequireComponent(typeof(Slider))]
@asus4
asus4 / c_cpp_properties.json
Created February 14, 2018 11:54
VSCode C/C++ intellisense setting for Platform IO Arduino-ESP32
{
"name": "Platform IO",
"includePath": [
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"$HOME/.platformio/packages/framework-arduinoespressif32",
@asus4
asus4 / Metal Film Resistors stock.md
Created February 14, 2018 07:32
My 1/4W Metal Film Resistors stock

Resistors


Ω


1.2Ω
1.5Ω
1.8Ω

@asus4
asus4 / import_zsh_history_to_fish.js
Last active February 6, 2018 14:24 — forked from christopherstott/import_zsh_history_to_fish.js
Import ZSH history to Fish
'use strict';
const fs = require('fs');
const expandHomeDir = require('expand-home-dir');
const zshHistoryRaw = fs.readFileSync(expandHomeDir('~/.zsh_history'), 'utf8');
const zshHistoryLines = zshHistoryRaw.split('\n');
const transformLine = line => {
try {
@asus4
asus4 / mov2h264
Last active January 23, 2018 11:53
Batch convert *.mov files into HEVC using ffmpeg
@echo off
cd /d %~dp0
setlocal ENABLEDELAYEDEXPANSION
for %%i in (*.mov) do (
echo %%i
set filename=%%i
echo !filename:.mov=.mp4!
ffmpeg.exe -y -i %%i -c:v h264_nvenc -pix_fmt yuv420p -preset llhq -profile:v main -b:v 20M !filename:.mov=.mp4!
@asus4
asus4 / openposeoptions.cpp
Created January 19, 2018 11:23
OpenPose options
DEFINE_int32(logging_level, 3, "The logging level. Integer in the range [0, 255]. 0 will output any log() message, while"
" 255 will not output any. Current OpenPose library messages are in the range 0-4: 1 for"
" low priority messages and 4 for important ones.");
DEFINE_bool(disable_multi_thread, false, "It would slightly reduce the frame rate in order to highly reduce the lag. Mainly useful"
" for 1) Cases where it is needed a low latency (e.g. webcam in real-time scenarios with"
" low-range GPU devices); and 2) Debugging OpenPose when it is crashing to locate the"
" error.");
// Producer
DEFINE_int32(camera, -1, "The camera index for cv::VideoCapture. Integer in
@asus4
asus4 / ffmpeg_hevc_options.txt
Last active April 15, 2023 23:44
ffmpeg GPU HEVC(H.265) encoder options
Encoder hevc_nvenc [NVIDIA NVENC hevc encoder]:
General capabilities: delay
Threading capabilities: none
Supported pixel formats: yuv420p nv12 p010le yuv444p yuv444p16le bgr0 rgb0 cuda d3d11
hevc_nvenc AVOptions:
-preset <int> E..V.... Set the encoding preset (from 0 to 11) (default medium)
default E..V....
slow E..V.... hq 2 passes
medium E..V.... hq 1 pass