This file contains 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 Graph() { | |
this.nodes = []; | |
this.edges = []; | |
}; | |
Graph.prototype.addNode = function(node) { | |
if(node) { | |
this.nodes.push(node); | |
} | |
}; |
This file contains 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 googlesort(a, b) { | |
var order = ['1', 'S', 'Galaxy', 'Q', '7', '4', '10', '5', '6']; | |
return order.indexOf(a) > order.indexOf(b); | |
} | |
console.log(['10', '6', '5', '4'].sort(googlesort)); | |
// [ '4', '10', '5', '6' ] |
This file contains 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
#!/bin/bash | |
# install homebrew | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# install brew-cask | |
brew install caskroom/cask/brew-cask | |
# install homebrew packages | |
brew install python |
This file contains 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
#!/bin/bash | |
# Homebrew | |
brew update | |
brew upgrade | |
brew cleanup | |
brew doctor | |
# Ohmyzsh | |
upgrade_oh_my_zsh |
This file contains 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 gaObj = window['GoogleAnalyticsObject']; | |
window[gaObj](function(tracker) { | |
return tracker.get('clientId'); | |
}); |
This file contains 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
void checkShaderForErrors(GLuint shaderID) { | |
// check shader for errors | |
glGetShaderiv(shaderID, GL_COMPILE_STATUS, &compile_status); | |
glGetShaderiv(shaderID, GL_INFO_LOG_LENGTH, &logLength); | |
logMsg = new GLchar[logLength + 1]; | |
glGetShaderInfoLog(shaderID, logLength, NULL, logMsg); | |
if (compile_status != GL_TRUE) { |
This file contains 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
/** | |
* Privileged methods. | |
* | |
* From http://www.crockford.com/javascript/private.html | |
*/ | |
function Container(param) { | |
function dec() { | |
if (secret > 0) { | |
secret -= 1; | |
return true; |
This file contains 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
#!/bin/sh | |
set -e | |
# Create image for deployment with Dokku | |
USERNAME=user # this is the user you will use to ssh into the server with | |
DOMAIN=example.com | |
echo 'Updating server...' | |
This file contains 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
/** | |
* Assignment 1 - COMP 4002 | |
* | |
* Includes: | |
* Part II: Task 3 and Task 4 | |
* Part III: Colouring bonus - recursive triangle is coloured. | |
* Part IV: Displacement parameter “dispX” | |
* | |
* Single and recursive triangles - with shaders | |
* |
This file contains 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
/** | |
* Assignment 1 - COMP 4002 | |
* Part 1: Task 1 and 2 | |
* | |
* Single and recursive triangles - no shaders | |
* | |
* Ryan Seys - 100817604 | |
* | |
* Compile on Mac with: | |
* $ g++ assign1.cpp -o assign -framework OpenGL -framework GLUT && ./assign |