Skip to content

Instantly share code, notes, and snippets.

Working from home

Kusa Mochi kusa-mochi

Working from home
View GitHub Profile
kusa-mochi / template.html
Last active Jun 9, 2017
Empty HTML for study with jQuery, jQuery Mobile, jQuery UI, Bootstrap
View template.html
<!DOCTYPE html>
<html lang="en">
<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">
<!-- jQuery Mobile -->
View ios_safari_full_screen.html
<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">
View wpf_default_style_example.xaml
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="White"/>
View 20180802_wpf_button_style_example.xaml
<Style x:Key="MyButtonStyle" TargetType="{x:Type Button}">
<Setter Property="Foreground" Value="Red"/>
View 20180802_wpf_button_apply_style_example.xaml
<Button Style="{DynamicResource MyButtonStyle}" Foreground="Blue" Content="くさもちはうまい"/>
View PartialCornerBorder.cs
using System.Windows;
using System.Windows.Controls;
namespace CommonControlParts
/// <summary>
/// 4つの角のCornerRadiusをXAMLから個別に指定できるようにしたBorder
/// </summary>
public class PartialCornerBorder : Border
View 20180804_partial_corner_border_usage.xaml
<ControlTemplate TargetType="{x:Type Button}">
<Grid x:Name="HiddenGrid" Visibility="Hidden">
<!-- ボタンの高さの1/4の値を取得するためだけに使うGrid -->
View BooleanToYesNoConverter.cs
using System;
using System.Globalization;
using System.Windows.Data;
namespace WpfApp1.Converters
/// <summary>
/// bool型を"はい"または"いいえ"に変換するコンバータ
/// </summary>
public class BooleanToYesNoConverter : IValueConverter
View 20180913_sample.ts
class Animal {
constructor(public name: string) { }
move(distanceInMeters: number = 0) {
console.log(`${} moved ${distanceInMeters}m.`);
class Snake extends Animal {
constructor(name: string) { super(name); }
move(distanceInMeters = 5) {
View 20180913_sample_002.ts
class MyClass {
constructor() { }
MyFunction(x: number) {
console.log(`the input number is ${x}.`);
let myInstance: MyClass = new MyClass();