This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="DiffFileSaver.Views.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" | |
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" | |
xmlns:l="http://schemas.livet-mvvm.net/2011/wpf" | |
xmlns:v="clr-namespace:DiffFileSaver.Views" | |
xmlns:vm="clr-namespace:DiffFileSaver.ViewModels" | |
xmlns:sys="clr-namespace:System;assembly=mscorlib" | |
xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Custom binding [ outerClick ] | |
* 要素の外側のクリックイベントに対してコマンドをバインドする | |
* | |
* binding-type: function/object | |
* binding-object: { | |
* command: [default:function] 要素の外側がクリックされた際に呼び出されるコールバック関数を指定する。 | |
* enable: true = commandの実行を可能にする。動的バインド可能。 | |
* デフォルトは true | |
* inners: 内側として扱う要素をCSSセレクタで指定する。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module 読み込み | |
*/ | |
var express = require('express'); | |
var routes = require('./routes'); | |
var user = require('./routes/user'); | |
var http = require('http'); | |
var path = require('path'); | |
var ECT = require('ect'); // ECT 読み込み |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery の fadeIn() / fadeout() メソッドを使ってエレメントの 可視/不可視 を切り替える | |
ko.bindingHandlers.fadeVisible = { | |
init: function(element, valueAccessor) { | |
var value = valueAccessor(); | |
$(element).toggle(ko.unwrap(value)); | |
}, | |
update: function(element, valueAccessor) { | |
var value = valueAccessor(); | |
ko.unwrap(value) ? $(element).fadeIn() : $(element).fadeOut(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<label> | |
<input type="checkbox" data-bind="checked: opened"/> | |
Open/Close | |
</label> | |
<div class="wrapper" id="a" data-bind="visualState: { opened: opened }"> | |
<div class="container" id="b"> | |
<div class="item" id="c"></div> | |
<div class="item" id="d"></div> | |
<div class="item" id="e"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div data-bind="variable: { foo: function(){ return doSomething(someProperty) } }"> | |
<!--ko if: foo == 'hoge'--> | |
<span data-bind="text: foo"></span> | |
<!--/ko--> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EntryController extendes Controller { | |
public function entriesAction() | |
{ | |
$limit = 10; // 1ページに表示する数 | |
// クエリストリングからページ番号を取得 ?page=1 | |
$page_num = $this->request->get('page', ['int'], 1); | |
$entries = Entries::find(); // なんかたくさん取得する(返ってくるのは Ginq) | |
// Ginq, ページ内表示数, ページ番号を渡す |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
参考: | |
3.2.3 テストケース: 連結リスト | |
http://rust-lang-ja.org/rust-by-example/custom_types/enum/testcase_linked_list.html | |
*/ | |
use List::*; | |
enum List { | |
// Cons: これは、要素をラップし、次の要素へのポインタを保持するタプル |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
keyname=$1 | |
if [ $# -lt 1 ] | |
then | |
echo "usage: ./github_deploy_key.sh <keyname>" | |
exit 1 | |
fi |