Skip to content

Instantly share code, notes, and snippets.

View kekyo's full-sized avatar
📡
I'm looking for a job

Kouji Matsui kekyo

📡
I'm looking for a job
View GitHub Profile
@kekyo
kekyo / make.bat
Created April 8, 2019 13:07
Embedding subtitles into mp4 container using ffmpeg
setlocal EnableDelayedExpansion
for %%p in (original\*.mp4) do (
rem echo "%%p" "%%~dp%%~pp%%~np.srt"
..\..\ffmpeg\bin\ffmpeg.exe -i "%%p" -i "%%~dp%%~pp%%~np.en.srt" -map 0:v -map 0:a -map 1:s -metadata:s:s:0 language=eng -c:v copy -c:a copy -c:s mov_text "%%~np.mp4"
)
@kekyo
kekyo / MainWindow.xaml
Created April 6, 2019 09:43
DelegateCommand on WPF
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Button x:Name="button">
TEST
@kekyo
kekyo / mysetjmp.asm
Created February 10, 2019 14:43
Self experiment implementation for the setjmp/longjmp at the x86-64 and masm platform.
.code
; struct
; {
; uint64_t Frame;
; uint64_t Rbx;
; uint64_t Rsp;
; uint64_t Rbp;
; uint64_t Rsi;
; uint64_t Rdi;
@kekyo
kekyo / main.c
Last active November 13, 2018 10:52
How to unwind the signal handler using the longjmp on Windows environment.
#include <stdio.h>
#include <signal.h>
#include <setjmp.h>
jmp_buf jb;
// Run in windows, this handler called from SEH filter context from "_seh_filter_exe()".
// The SEH __try - __except() block contains at "__scrt_common_main_seh(),"
// the callgraph is:
// __scrt_common_main_seh() --> __try --> main() --> [SEGV] --> __except() --> _seh_filter_exe() --> handler()
@kekyo
kekyo / Program.cs
Last active November 10, 2018 06:20
What kind of order did we handle exception with filter expressions.
using System;
namespace ExceptionTest
{
class Program
{
static string GetMessage(Exception ex, string banner)
{
Console.WriteLine(banner);
return ex.Message;
@kekyo
kekyo / Program.cs
Created October 12, 2018 14:59
BrainPad demonstration at MADOBEN YOKKAICHI 2018
using GHIElectronics.TinyCLR.BrainPad;
using System;
using System.Collections;
using System.Text;
using System.Threading;
namespace TinyCLRApplication1
{
class Program
{
@kekyo
kekyo / BrainPad_ChristmasLight.js
Created October 6, 2018 13:57
BrainPad - Christmas light demo (Using APA102 LED belt, from BrainPad Beginners guide)
let center = 12
let startRed = 0
let startGreen = 0
let startBlue = 0
let red = 0
let green = 0
let blue = 0
let data: Buffer = pins.createBuffer(4)
let dummy: Buffer = pins.createBuffer(4)
@kekyo
kekyo / Program.cs
Created July 3, 2018 09:47
Tracing behavior test
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp2
{
class CalendarControl
@kekyo
kekyo / Wio3GDacTest.ino
Created May 3, 2018 10:32
DAC enabled Wio 3G test code.
// https://github.com/kekyo/SeeedJP_STM32F4/commit/cf9cd45caaae41c1d5e71eeec5ea3d25bcc2dae0
#include <Wio3GforArduino.h>
Wio3G Wio;
void setup()
{
SerialUSB.begin(115200);
SerialUSB.println("");
@kekyo
kekyo / Program.cs
Created April 17, 2018 00:10
イラク復興支援群の日報 370日分 - 朝日新聞
using System;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using AngleSharp.Dom.Html;
using AngleSharp.Parser.Html;
namespace ConsoleApp1
{