View gist:dbb267f88dacc247e5df5d0718de345e
// A*
// Much thanks to http://www.geeksforgeeks.org/a-search-algorithm/
// Extending array
Array.prototype.empty = function() {
return this.length == 0;
};
// Constants
var SQUARE_SIZE = 100;
View equation.js
var equation = "1+(3+(3-2))*5/2";
var process = function(arr) {
if (arr.length == 1) {
return parseFloat(arr[0]);
}
var number = arr[0];
var operator = arr[1];
View .java
public class Hangman {
private String wordToGuess = "t";
private boolean gameRunning = true;
private int guessCount = 4;
public void playGame() {
while (gameRunning) {
View .java
public class Hangman {
private String wordToGuess = "t";
private boolean gameRunning = true;
private int guessCount = 4;
public void playGame() {
while (gameRunning) {
View gist:f272434825c0cc8ab5a4
/**
* Prep Code
*/
// PICK A WORD
// LOOP
// LET THE PLAYER GUESS
// IF GUESS == TRUE
// CHECK IF WORD IS COMPLETE
// YOU WIN
View gist:8dc4258a1360d3002b12
public void drawBackground() {
// CIRCLE is a static var defined as MATH.PI * 2
// graphics() returns a Graphics2D context in this case from a BufferedImage createGraphics() method
rotationOfBackground += 0.05;
if(rotationOfBackground >= CIRCLE) {
rotationOfBackground -= CIRCLE;
}
// In this case we're assuming that 300 is the height that we need
int width = (int)(background.getWidth(this));
View gist:795ea00e24210177f443
(function ( $ ) {
$.fn.where = function(status) {
var len = this.size();
for(var i=0; i < len; i++) {
if ($(this[i]).is(status)) {
return $(this[i]);
}
}
return [];
View gist:5a0ba5a285f5719f339e
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
menu_execute_active_handler();
drupal_flush_all_caches();
/**
* The intent is to clear the caches so that when multiple people are sharing the same db in dev,
* CSS / Template caching collisions don't occur.
View gist:4a6df7c96ca65677159b
mysqldump -h localhost -p -u root cookbook > cookbook.sql
View gist:d7b6f4b442aa3bb71a6f
docker rm $(docker ps -a -q)
# From https://coderwall.com/p/ewk0mq