Skip to content

Instantly share code, notes, and snippets.

@ericpkatz
Created February 5, 2015 02:16
Show Gist options
  • Select an option

  • Save ericpkatz/ef37b5a4481edf42247a to your computer and use it in GitHub Desktop.

Select an option

Save ericpkatz/ef37b5a4481edf42247a to your computer and use it in GitHub Desktop.
Class One 9053 // source http://jsbin.com/qucojo
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<meta name="description" content="Class One 9053" />
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div class="container">
<h1>Hello World</h1>
<div class="alert alert-info">
Info!!!!
</div>
</div>
<script id="jsbin-javascript">
var arr = [];
var stats = {
};
for(var i=1; i <= 1000; i++){
arr.push(Math.ceil(Math.random()*15));
}
for(var i = 0; i < arr.length; i++){
var key = arr[i];
if(!(key in stats)){
stats[key] = 0;
}
stats[key] = stats[key] + 1;
}
console.log(stats);
</script>
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery.min.js"><\/script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"><\/script>
<meta name="description" content="Class One 9053" />
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div class="container">
<h1>Hello World</h1>
<div class="alert alert-info">
Info!!!!
</div>
</div>
</body>
</html></script>
<script id="jsbin-source-javascript" type="text/javascript">var arr = [];
var stats = {
};
for(var i=1; i <= 1000; i++){
arr.push(Math.ceil(Math.random()*15));
}
for(var i = 0; i < arr.length; i++){
var key = arr[i];
if(!(key in stats)){
stats[key] = 0;
}
stats[key] = stats[key] + 1;
}
console.log(stats);
</script></body>
</html>
var arr = [];
var stats = {
};
for(var i=1; i <= 1000; i++){
arr.push(Math.ceil(Math.random()*15));
}
for(var i = 0; i < arr.length; i++){
var key = arr[i];
if(!(key in stats)){
stats[key] = 0;
}
stats[key] = stats[key] + 1;
}
console.log(stats);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment