Skip to content

Instantly share code, notes, and snippets.

Harry Truong harrytruong

Block or report user

Report or block harrytruong

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:c5c1584b37657cb95551a3d393263314
<html>
<body>
<img src="foo.png" onError="reloadImage(this)" />
<script>
function reloadImage(img) {
setTimeout(function(){ img.src = img.src; }, 5000);
}
</script>
</body>
</html>
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>queuing system</title>
</head>
<body>
<input id="num" name="num" />
<input id="item" name="item" />
<button>add</button>
View gist:626f42a19e0e4ddbfad9
//
// const fn = (format, strings) => {
// const regex = new RegExp(`^${format}$`);
// return Object.keys(strings.reduce((res, str) => {
// if (str.match(regex)) res[str] = true;
// return res;
// }, {}));
// }
strings = {};
@harrytruong
harrytruong / simplified-rank.html
Created Aug 18, 2015
Simplified Tic-Tac-Toe AI Ranking Issue
View simplified-rank.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script>
// organize possible plans, based on grid data, solutions and marks
function plans(data, solutions, marks){
var plans = {offense: [], defense: [], neutral: []};
You can’t perform that action at this time.