This file contains hidden or 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
var btnEl = document.getElementById('btn'); | |
btnEl.addEventListener('click', function(e) { | |
var target = e.currentTarget; | |
//btnElに指定したイベントをremove | |
target.removeEventListener('click', arguments.callee, false); | |
}); |
This file contains hidden or 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
var shuffleArray = function(arr) { | |
for(var i = arr.length - 1; i >= 0; i--) { | |
var random = Math.floor(i * Math.random()); | |
var tmp = arr[i]; | |
arr[i] = arr[random]; | |
arr[random] = tmp; | |
} | |
return arr; | |
}; |
This file contains hidden or 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
<body ng-controller="ShoppingController"> | |
<table> | |
<h1>Shop!</h1> | |
<tr ng-repeat="item in items"> | |
<td>{{item.title}}</td> | |
<td>{{item.description}}</td> | |
<!-- filter: yenを使用する --> | |
<td>{{item.price | yen}}</td> |
This file contains hidden or 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
<html ng-app> | |
<head> | |
<meta charset="UTF-8"> | |
<title>restaurantTable</title> | |
<style> | |
.selected { | |
background: lightgreen; | |
} | |
</style> | |
</head> |
This file contains hidden or 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
<!--ng-appにmyAppをセット--> | |
<html ng-app='myApp'> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Text</title> | |
</head> | |
<body ng-controller="TextController"> | |
<p>{{someText.message}}</p> | |
<script src="../bower_components/angular/angular.js"></script> | |
<script> |
This file contains hidden or 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
<html ng-app> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Your Shopping Cart</title> | |
</head> | |
<body ng-controller="CartController"> | |
<h1>Yout Shopping Cart</h1> | |
<div ng-repeat="item in items"> | |
<span>{{item.title}}</span> | |
<input ng-model="item.quantity"> |
This file contains hidden or 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
function HelloController($scope) { | |
$scope.greeting = { text: 'Hello World!' }; | |
} |
This file contains hidden or 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
<!-- createJSのライブラリを読み込む前に以下を実行する--> | |
<script> | |
var createjs = window; | |
</script> | |
<!-- createJSのライブラリを読み込む--> | |
<script src="http://code.createjs.com/createjs-2013.09.25.min.js"></script> | |
<!-- 実行ソース--> | |
<script> | |
var canvasEl = document.getElementById("myCanvas"); | |
This file contains hidden or 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
public class HelloWorld { | |
public static void main (String[] args) { | |
System.out.println("Hello World!!"); | |
} | |
} |
This file contains hidden or 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
alias javac='javac -J-Dfile.encoding=UTF-8' | |
alias java='java -Dfile.encoding=UTF-8' |