Skip to content

Instantly share code, notes, and snippets.

View greyscaled's full-sized avatar
⛰️
Taking a break

Grey greyscaled

⛰️
Taking a break
  • Hamilton, ON
  • 15:36 (UTC -04:00)
View GitHub Profile
@greyscaled
greyscaled / docker_wordpress.md
Created July 9, 2019 05:32 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@greyscaled
greyscaled / books.md
Created November 27, 2018 16:22 — forked from abstractart/books.md
Free Programming Ebooks - O'Reilly Media. Codeship free ebooks here - https://bit.ly/2oQ0knQ
@greyscaled
greyscaled / MainCLI.java
Last active September 26, 2018 19:20
A Command Line interface for SlotMachine.java and SlotMachineMain.java
import java.util.Scanner;
import java.util.regex.Pattern;
import mediumjavafxmvcexample.SlotMachine.ROUTES;
public class MainCLI {
private final SlotMachine smOne;
private final SlotMachine smTwo;
private final Pattern commands = Pattern.compile(
"^machine (1|2) select route (1|2)$"
@greyscaled
greyscaled / SlotMachineMain.java
Last active September 26, 2018 19:19
Main using SlotMachineTab.fxml SlotMachine.java and SlotMachineTabController.java
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.stage.Stage;
/**
* Main class. Sets up a JavaFX scene and runs a System.in/out thread.
*/
@greyscaled
greyscaled / SlotMachineTabController.java
Created September 26, 2018 14:48
Controller for SlotMachineTab.fxml
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.text.Text;
/**
* FXML Controller class for SlotMachineTab.fxml
*/
public class SlotMachineTabController {
/**
* SlotMachine Model
@greyscaled
greyscaled / SlotMachineTab.fxml
Created September 26, 2018 14:39
FXML Template for SlotMachine.java
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.net.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.Text?>
@greyscaled
greyscaled / SlotMachine.java
Last active September 26, 2018 14:05
SlotMachine
import javafx.beans.property.SimpleStringProperty;
/**
* Class representing a transit ticket vending machine. This is an example
* and only demonstrates a single property: selecting a transit route.
*/
public final class SlotMachine {
/**
* ROUTES that tickets can be issued for
module.exports = function ({ port }) {
const debug = require('debug')('run__on::server::app.js')
const express = require('express')
const path = require('path')
const helmet = require('helmet')
const RateLimit = require('express-rate-limit')
const { internalError } = require('./middleware')
// Configuration ----------------/
/**
* A set of static methods governing string-to-int conversion
* in base26. In base26, only lowercase alpha chars [a-z]
* are valid and map to an integer range (0, 26]
*/
module.exports = {
/**
* returns the base26 integer corresponding with the provided char. Note
* that by design uppercase chars may be supplied, and are
const Base26 = require('./base26')
/** The Radix of the Trie. In thise case, base 26 */
const R = 26
/**
* An node contains a value and links that point to other nodes.
* @typedef {Object} Node
* @property {any} value
* @property {Array} next