Skip to content

Instantly share code, notes, and snippets.

View taterbase's full-sized avatar

George Shank taterbase

View GitHub Profile
@taterbase
taterbase / system-beep.js
Created July 21, 2012 05:01
System Beep in Node.js
function alertTerminal(){
console.log("\007");
}
@taterbase
taterbase / house-1.json
Created August 9, 2012 12:08
house description
{
"owner":{
"name": "George",
"job": "Developer",
"favoriteBurrito": "breakfast"
},
"street": "123 Fake st.",
"city": "American Fork",
"state": "UT"
}
{
"owner":{
"name": "George",
"job": "Developer",
"favoriteBurrito": "breakfast"
},
"children": [
{
"name": "Sara",
"age" : 5,
@taterbase
taterbase / index.html
Created August 15, 2012 15:48 — forked from anonymous/index.html
A web page created at CodePen.io.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- IF PEN IS PRIVATE -->
<!-- <meta name="robots" content="noindex"> -->
<!-- END -->
@taterbase
taterbase / fun.js
Created September 25, 2012 00:16
Wat
(function(fn){
fn(fn);
}(function(fn){
fn(fn)
}));
@taterbase
taterbase / regex-interpolation.js
Created October 23, 2012 05:16
Regex for matching interpolated string var
//Finds all instances of #{} style interpolation like #{variable}
string.match(/#{[^}\r\n]*}/g);
@taterbase
taterbase / equilibrium.js
Created November 16, 2012 03:55
Equilibrium
function equi ( A ) {
var N = A.length;
for(var val in A){
if(check(val, A))
return val;
}
return false
}
@taterbase
taterbase / ricechess.js
Created November 16, 2012 04:24
Rice and chess
function rice_chessboard ( A ) {
return checkPath(A[0][0], 0, 0, A)
}
function checkPath(val, x, y, board){
if(board[x + 1] && board[x][y+1]){ //If there is room
var possibility1 = checkPath(val + board[x][y+1], x, (y+1), board);
var possibility2 = checkPath(val + board[x+1][y], (x+1), y, board);
return possibility1 > possibility2 ? possibility1 : possibility2;
@taterbase
taterbase / stringsymmetry.js
Created November 16, 2012 04:51
String Symmetry
function symmetryPoint ( S ) {
var length = S.length;
if(length === 1)
return 0;
if(length % 2 === 0)
return -1;
var midpoint = Math.floor(length / 2);
var fString = S.substring(0, midpoint);
@taterbase
taterbase / test.md
Created December 7, 2012 05:03
Test Readme

#LOL