Skip to content

Instantly share code, notes, and snippets.

View hawksprite's full-sized avatar

Justin Barnyak hawksprite

View GitHub Profile
class Forms
{
private static $initialized = false;
private static function initialize()
{
if (self::$initialized)
return;
self::$initialized = true;
<?php
class Forms
{
private static $initialized = false;
private static function initialize()
{
if (self::$initialized)
return;
<?php
echo Forms::buildForm("new-user", "index.php?act=manager", array("First Name", "Last Name"), array("text", "text"), array("first", "last"));
?>
for (int i = 0; i < r.attemptCount.Length; i++) {
if (r.access [i] == 1) {
// Handle missed
if (r.attemptCount [i] <= 0) {
missed = true;
}
// Check for a score lower then given thresholds
if (r.topAssignmentScore [i] <= 79) {
completedThresh = false;
public class Downloader {
public bool Finished = false;
public double TotalBytes = 0;
public double BytesRecieved = 0;
// Percent stuff
public float Progress { get { return ((float)Progress_Percent) / 100.0f; } }
public int Progress_Percent = 0;
private Thread downloadFileThread;
void DownloadDatFile()
{
// The class is inherinty async so you don't need to put it in a thread, but if you want to monitor the progress
// in a "Snappy" manor in something like unity without worrying about the possible frame cap to disrupt thing from the Update callback
// then just use this setup to monitor it with a standard .NET thread
downloadFileThread = new Thread(new ThreadStart(threadDownloadDatFile));
downloadFileThread.Start();
https://gist.github.com/
#!/bin/bash
sudo rm -r SL_Sparky
sudo rm -r /var/api/*
sudo git clone https://github.com/hawksprite/SL_Sparky.git
sudo cp -r SL_Sparky/Sparky/Sparky/* /var/api/
<?php
// Connect to DB
$hostName = "localhost";
$userName = "root";
$password = "#";
$dbName = "class";
$link = mysqli_connect($hostName, $userName, $password, $dbName) or die ("Error" . mysqli_error($link));
int maxSpawn = 30; // Every 30 milliseconds
int minSpawn = 1000; // Every 1000 milliseconds
int maxTime = 300000; // How long till we reach the maximum spawn rate, 5 minutes in milliseconds
DateTime born;
DateTime spawn;