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 / 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 December 12, 2024 16:25
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
@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