Skip to content

Instantly share code, notes, and snippets.

View kusa-mochi's full-sized avatar
🏠
Working from home

Kusa Mochi kusa-mochi

🏠
Working from home
View GitHub Profile
@kusa-mochi
kusa-mochi / template.html
Last active June 9, 2017 14:33
Empty HTML for study with jQuery, jQuery Mobile, jQuery UI, Bootstrap
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>練習用HTMLテンプレート</title>
<!-- jQuery Mobile -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="initial-scale=1.0">
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="White"/>
</Style>
<Style x:Key="MyButtonStyle" TargetType="{x:Type Button}">
<Setter Property="Foreground" Value="Red"/>
</Style>
<Button Style="{DynamicResource MyButtonStyle}" Foreground="Blue" Content="くさもちはうまい"/>
using System.Windows;
using System.Windows.Controls;
namespace CommonControlParts
{
/// <summary>
/// 4つの角のCornerRadiusをXAMLから個別に指定できるようにしたBorder
/// </summary>
public class PartialCornerBorder : Border
{
<ControlTemplate TargetType="{x:Type Button}">
<Grid>
<Grid x:Name="HiddenGrid" Visibility="Hidden">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<!-- ボタンの高さの1/4の値を取得するためだけに使うGrid -->
using System;
using System.Globalization;
using System.Windows.Data;
namespace WpfApp1.Converters
{
/// <summary>
/// bool型を"はい"または"いいえ"に変換するコンバータ
/// </summary>
public class BooleanToYesNoConverter : IValueConverter
class Animal {
constructor(public name: string) { }
move(distanceInMeters: number = 0) {
console.log(`${this.name} moved ${distanceInMeters}m.`);
}
}
class Snake extends Animal {
constructor(name: string) { super(name); }
move(distanceInMeters = 5) {
class MyClass {
constructor() { }
MyFunction(x: number) {
console.log(`the input number is ${x}.`);
}
}
let myInstance: MyClass = new MyClass();
myInstance.MyFunction(3);