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
<template>
<div>
<div v-if="sampleProp === 1">template A</div>
<div v-else-if="sampleProp === 2">template B</div>
<div v-else>template C</div>
</div>
</template>
<script>
export default {
@kusa-mochi
kusa-mochi / 20200307_003.vue
Last active March 7, 2020 09:07
sample vue component
<template>
<div class="my-class">
サンプル{{sampleData}}
</div>
</template>
<script>
export default {
name: 'MyComponent',
data () {
<TextBox x:Name="TestTextBox" Grid.Column="1" HorizontalAlignment="Center" Height="23" TextWrapping="Wrap" VerticalAlignment="Center" Width="200">
<TextBox.Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Text" Value="りんご"/>
<Style.Triggers>
<DataTrigger Binding="{Binding TestFlag}" Value="True">
<Setter Property="Text" Value="バナナ"/>
</DataTrigger>
</Style.Triggers>
</Style>
<TextBox x:Name="TestTextBox" Grid.Column="1" HorizontalAlignment="Center" Height="23" TextWrapping="Wrap" Text="りんご" VerticalAlignment="Center" Width="200">
<TextBox.Triggers>
<DataTrigger Binding="{Binding TestFlag}" Value="True">
<Setter Property="Text" Value="バナナ"/>
</DataTrigger>
</TextBox.Triggers>
</TextBox>
<!-- 色を定義する -->
<SolidColorBrush x:Key="BaseBrush" Color="#EEEEEE" />
<!-- BaseBrushの色を参照するSolidColorBrush -->
<SolidColorBrush x:Key="SampleBrush" Color="{Binding Color, Source={StaticResource BaseBrush}}" />
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8"/>
</head>
<body>
本文
</body>
</html>
<?php
// main.php
// 外部ファイルのインポート
require_once 'Soda.php';
// 名前空間のエイリアス
use Mochi\MyNamespace as Mine;
// Sodaクラスのインスタンスの生成。コンストラクタの呼び出し。
<?php
// Soda.php
// 名前空間の定義
namespace Mochi\MyNamespace;
// 外部ファイルのインポート
require_once 'Drink.php';
// クラスの継承
@kusa-mochi
kusa-mochi / Drink.php
Last active August 6, 2019 13:50
クラス定義の例
<?php
// Drink.php
// 名前空間の定義
namespace Mochi\MyNamespace;
// クラスの定義
class Drink
{
// メンバ変数
@kusa-mochi
kusa-mochi / html.json
Last active July 13, 2019 05:01
html snippet for vscode.
{
"html": {
"prefix": "htmltemplate",
"body": [
"<!DOCTYPE html>",
"<html lang=\"$1\">",
"\t<head>",
"\t\t<meta charset=\"$2\"/>",
"\t\t<title>$3</title>",
"\t</head>",