Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Yutaka TSUMORI tmyt

🏠
Working from home
View GitHub Profile
View XInput.cs
using System.Runtime.InteropServices;
namespace Interop
{
static class XInput
{
public const int XUserMaxCount = 4;
/**
* <summary>Sets the reporting state of XInput.</summary>
View UnityHost.cs
public class UnityHost : HwndHost
{
private const uint STARTF_USEPOSITION = 0x0004;
private const uint STARTF_USESIZE = 0x0002;
private Process _childProcess;
private HandleRef _childHandleRef;
public string AppPath { get; set; }
public HandleRef Child => _childHandleRef;
View detect_netcore.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace detect_coreclr_dll
{
class Program
{
View icuuc.cs
using System.Runtime.InteropServices;
using System.Text;
/*
* C#からWindows 10 16299以降で利用できるicuuc.dllを呼び出す定義
*/
namespace icusample.Interop
{
using UBreakIterator = System.IntPtr;
@tmyt
tmyt / generic.xaml
Created May 21, 2018
windows phone 8.1 - system theme
View generic.xaml
<?xml version="1.0" encoding="utf-8"?>
<!--
//
// Copyright (c) Microsoft Corporation. All Rights Reserved.
//
-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Windows.UI.Xaml.Controls" xmlns:primitives="using:Windows.UI.Xaml.Controls.Primitives"
xmlns:animation="using:Windows.UI.Xaml.Media.Animation" xmlns:maps="using:Windows.UI.Xaml.Controls.Maps">
<!--
View init-wsl.sh
#!/bin/bash
# Make symbolic link
userprofile=$(cmd.exe /C set | grep -i '^userprofile=' | cut -d '=' -f 2 | tr '\\' '/' | tr -d ':' | tr -d '[:cntrl:]')
ln -s /mnt/${userprofile,} ~/Profile
ln -s ~/Profile/Documents ~/Documents
ln -s ~/Profile/Downloads ~/Downloads
ln -s ~/Profile/Desktop ~/Desktop
# configure bash
View gist:6dd13ad3ee430e97b2e264d03861698d
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Microsoft.Xaml.Interactivity;
namespace Tetraptera.Views.Behaviors
{
public class SelectTemplateBehavior : DependencyObject, IBehavior
{
public void Attach(DependencyObject associatedObject)
{
@tmyt
tmyt / generic.xaml
Last active May 21, 2018
windows 8.1 - system theme
View generic.xaml
<!--
//
// Copyright (c) Microsoft Corporation. All Rights Reserved.
//
-->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.ThemeDictionaries>
View gist:0b1f97d2f63009fa89d1efddfe951e8f
using System;
namespace Common
{
public static class Try
{
public static TResult Catch<TException, TResult>(Func<TResult> func, TResult fallback = default(TResult))
where TException : Exception
{
try
View boot-img-split.txt
% ../split_bootimg.pl boot.img 2016/05/31 18:04:19
Page size: 4096 (0x00001000)
Kernel size: 10391926 (0x009e9176)
Ramdisk size: 1626781 (0x0018d29d)
Second size: 0 (0x00000000)
Board name:
Command line: console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-3
Base address: (0x00000000)
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.