Skip to content

Instantly share code, notes, and snippets.

@kevincolten
kevincolten / WordSearch.js
Last active September 13, 2015 15:37
Algorithms
'use strict';
// https://www.youtube.com/watch?v=kPRA0W1kECg
var LineByLineReader = require('line-by-line');
var prompt = require('prompt');
var wordList = new LineByLineReader('./sample_words.txt');
var words = [];
@kevincolten
kevincolten / index.html
Created September 7, 2015 05:04
Material Backbone App
<!---->
@kevincolten
kevincolten / TowersOfHanoi.js
Last active September 6, 2015 03:52
Towers of Hanoi (GUI)
$(document).ready(function() {
var block;
function checkForWin() {
var gameWon = false;
$('[data-stack]').each(function () {
if ($(this).data('stack') !== 1 && $(this).children().length === 4) {
gameWon = true;
}
});
@kevincolten
kevincolten / TicTacToe.js
Last active October 23, 2015 01:33
TicTacToe (GUI)
'use strict';
$(document).ready(function() {
var playerTurn = 'X';
$('[data-cell]').on('click', function() {
$(this).text(playerTurn);
checkForWin();
playerTurn = (playerTurn === 'X') ? 'O' : 'X';
});
@kevincolten
kevincolten / Checkers.js
Created September 5, 2015 18:44
Checkers
var colors = require('colors/safe');
var prompt = require('prompt');
function Checker(color, position) {
this.team = color;
this.symbol = null;
if (color === 'red') {
this.symbol = colors.red(String.fromCharCode(0x12022));
} else {
@kevincolten
kevincolten / RockPaperScissors.js
Last active August 29, 2015 02:35
Rock Paper Scissors
'use strict';
var prompt = require('prompt');
prompt.start();
function compareHands(hand1, hand2) {
if (hand1 === hand2) {
return "It's a tie!";
}
@kevincolten
kevincolten / TicTacToe.js
Last active September 19, 2015 20:56
Tic Tac Toe
'use strict';
var prompt = require('prompt');
prompt.start();
var board = [
[' ', ' ', ' '],
[' ', ' ', ' '],
[' ', ' ', ' '],
[' ', ' ', ' ']
@kevincolten
kevincolten / TowersOfHanoi.js
Last active September 27, 2015 21:28
Towers of Hanoi
'use strict';
var prompt = require('prompt');
prompt.start();
var stacks = {
a: [4, 3, 2, 1],
b: [],
c: []
};
@kevincolten
kevincolten / lines.html
Created August 12, 2015 16:53
Comparing Consecutively Ran Bokeh Plots
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>line.py example</title>
<link rel="stylesheet" href="bokehjs/build/css/bokeh.css" type="text/css" />
<script type="text/javascript" src="bokehjs/build/js/bokeh.js"></script>
<script type="text/javascript">
Bokeh.set_log_level("info");
</script>
@kevincolten
kevincolten / post.md
Last active October 24, 2023 00:11
@post Hosting Multiple Repositories With GitHub Pages

GitHub Pages is great for building a personal or project website. It'll default to http://username.github.io, or you can even use your own custom domain name from services like Namecheap, which I will write about in another post soon.

So you set up your GitHub Page for yourself or project, but what if you want to show off some of your other projects you are working on. You can go the poor man's route, and simply just copy everything from another repository into a folder in your username.github.io repository, commit and push the changes to GitHub, and you'll be able to navigate to http://username.github.io/project.

But this comes with some seriously inconvienent and non-conventional drawbacks, such as duplication of code across repositories and manually copy/paste-ing everytime changes are made to update your hosted codebase. Good luck maintaining that.

The other