Skip to content

Instantly share code, notes, and snippets.

View Brobin's full-sized avatar
☣️
Working Remote

Tobin Brown Brobin

☣️
Working Remote
View GitHub Profile
@Brobin
Brobin / ProjectEuler.py
Last active August 29, 2015 13:56
Project Euler Solutions
"""These are my solutions to the first 10 problems in Project Euler (https://projecteuler.net/)
I will continue to add more as I solve them
Tobin
02/18/2014
"""
"""Problem 1: If we list all the natural numbers below 10 that are multiples of 3 or 5,
we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples
of 3 or 5 below 1000.
@Brobin
Brobin / TowersOfHanoi.py
Last active September 21, 2022 07:48
Towers of Hanoi solution in Python
"""The Tower of Hanoi (also called the Tower of Brahma or Lucas' Tower,[1] and sometimes pluralised)
is a mathematical game or puzzle.
It consists of three rods, and a number of disks of different sizes which can slide onto any rod.
The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the smallest
at the top, thus making a conical shape.
The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules:
1. Only one disk can be moved at a time.
2. Each move consists of taking the upper disk from one of the stacks and placing it on top of another
@Brobin
Brobin / Yoda.java
Created February 18, 2014 21:11
Compile and run you must
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
/**
* I got bored one day while learning about GUIs so I made this.
* */
public class Yoda {
/**
* A quick little group of methods that I mad eup while working ona java database project
* Dates in java are really annoying. These methods provide a quick and easy way to convert
* between different types and get the start and end dates for a given month.
*
* java.util.Date is the java class library for dates that is technically measured in seconds
* and has methods to assign integer values for day, month, and year
*
* java.sql.Date is the date library for dates entered into an SQL database using JDBC. It
* extends java.util.Date, so most of the methods can be reused, but conversions need to be made.
@Brobin
Brobin / mysqli.php
Last active August 29, 2015 14:02
Examples of mysqli for personal reference
<?php
/**
* These variables (strings) contain data to connect to the database
*/
$hostname = "";
$username = "";
$password = "";
$database = "";
@Brobin
Brobin / medoo-example.php
Created June 6, 2014 02:58
Medoo PHP example
<?php
require "medoo.min.php";
$db = new medoo();
$posts = $db->select("posts", array("title", "excerpt", "id"), array("ORDER"=>"id DESC", "LIMIT" => 10));
foreach($posts as &$post) {
echo "<h1>".$post["title"]."</h1><br>";
@Brobin
Brobin / food.php
Created September 4, 2014 00:54
UNL Menu
<?php
header('Content-Type: application/json');
header("Access-Control-Allow-Origin: *");
$meal = $_GET['meal'];
$hall = $_GET['hall'];
switch($hall)
{
Team Games W L OTL ROW Points Points % Diff GPG GAPG PP % PK % FO %
Columbus Blue Jackets 42 29 9 4 27 62 73.8% +46 3.36 2.26 26.0% 83.0% 47.7%
Washington Capitals 43 29 9 5 28 63 73.3% +45 3.05 2.00 18.5% 86.5% 50.7%
Minnesota Wild 41 27 9 5 26 59 72.0% +45 3.29 2.20 19.5% 84.6% 51.9%
Montréal Canadiens 44 27 11 6 26 60 68.2% +26 3.14 2.55 21.9% 78.3% 50.1%
Pittsburgh Penguins 42 26 11 5 24 57 67.9% +21 3.45 2.95 22.8% 78.2% 47.8%
Chicago Blackhawks 45 27 13 5 25 59 65.6% +11 2.76 2.51 18.8% 76.3% 48.2%
New York Rangers 44 28 15 1 26