Skip to content

Instantly share code, notes, and snippets.

View tshm's full-sized avatar

tosh shimayama (satake) tshm

View GitHub Profile
@tshm
tshm / Serialize.ts
Last active February 2, 2020 03:01
typescript annotaion for fixed size message convertion
import 'reflect-metadata';
interface Iprops {
name: string;
size: number;
type: any;
}
let classes: { [key: string]: Iprops[] } = {};
let totalsize = {};
@tshm
tshm / machine.js
Created December 18, 2019 07:54
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@tshm
tshm / setlanguage.ps1
Last active August 21, 2017 05:04
setlanguage.ps1
$RegKeyPath = "HKU:\Control Panel\International"
Import-Module International
Set-WinSystemLocale ja-JP
Set-Culture ja-JP
# Get-WinUserLanguageList
Set-WinUserLanguageList ja-JP -Force
@tshm
tshm / wifisignal.ps1
Created August 7, 2017 11:41
wifi signal retriever
$strDump = netsh wlan show interfaces
$objInterface = "" | Select-Object SSID,BSSID,Signal
foreach ($strLine in $strDump) {
if ($strLine -match "^\s+SSID") {
$objInterface.SSID = $strLine -Replace "^\s+SSID\s+:\s+",""
} elseif ($strLine -match "^\s+BSSID") {
$objInterface.BSSID = $strLine -Replace "^\s+BSSID\s+:\s+",""
} elseif ($strLine -match "^\s+Signal") {
$objInterface.Signal = $strLine -Replace "^\s+Signal\s+:\s+",""
@tshm
tshm / cvimrc.vim
Last active May 15, 2017 00:21
cvim configuration template
set nosmoothscroll
set numerichints
set typelinkhints
set noautofocus
set autoupdategist
set nativelinkorder
let barposition = "bottom"
map l gt
@tshm
tshm / template.elm
Created May 14, 2016 22:08
elm app template
port module Main exposing (..)
import Html.App as Html
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
import Json.Decode as Json
import Debug exposing (..)
main : Program Never
@tshm
tshm / elm-node.js
Created May 6, 2016 15:40
allow running Elm compiled code from nodejs
/** allow to use Elm from nodejs...
*/
const vm = require('vm')
const fs = require('fs')
function log( o ) {
console.log( o )
}
/** loads Elm compiled javascript
@tshm
tshm / gv.js
Last active April 4, 2016 23:10
gv bookmarklet dev.
// use following converter:
// http://chriszarate.github.io/bookmarkleter/
var d = document;
var re = new RegExp(/(\+\d{1,2})?([ ()-]{0,2}\d{3,4}){2,3}\b/);
var createLink = function(txt) {
var a = d.createElement('a');
a.setAttribute('class', '_ph_');
a.href='#';
a.setAttribute('data-clipboard-text', txt);
@tshm
tshm / ViewModelBase.cs
Created March 21, 2016 18:30
ViewModel base class for WPF application.
using System;
using System.Windows.Threading;
using System.Diagnostics;
using System.ComponentModel;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Windows;
namespace ViewModels
{
@tshm
tshm / mixedkbd.reg
Created March 14, 2016 15:14
日本語キーボードのPCに、外付け英語キーボードを繋いだ場合のRegistry設定
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters]
"PollingIterations"=dword:00002ee0
"PollingIterationsMaximum"=dword:00002ee0
"ResendIterations"=dword:00000003
"LayerDriver JPN"="kbd101.dll"
"LayerDriver KOR"=""
"OverrideKeyboardIdentifier"="PCAT_101KEY"
"OverrideKeyboardType"=dword:00000007