Skip to content

Instantly share code, notes, and snippets.

View brentonstrine's full-sized avatar

Brenton Strine brentonstrine

View GitHub Profile
@brentonstrine
brentonstrine / api.php
Last active June 26, 2019 02:06 — forked from sroehrl/api.php
Concept of an API (for learning, not production)
<?php
/* MOST SIMPLE API */
/*
* Add functions to class Methods
* currently, the script supports the call api.php/test
* */
// respond as JSON
// Student project: Rock Paper Scissors
//
// define score variables for however many players there are
var p1s = 0;
var p2s = 0;
// define variables that keep track of whatever the players choose, whether rock, paper, or scissors.
var p = {
@brentonstrine
brentonstrine / colorScroller.js
Last active October 1, 2016 16:06
Scroll through blocks of color while scrolling
//for an example of this working, see the hamburger menu on mobile at brentonstrine.com
//define colors to scroll through
var colorWheel = [
"chocolate",
"coral",
"cornflowerblue",
"darkslateblue",
"crimson",
"darkcyan",
@brentonstrine
brentonstrine / css-compress.php
Last active December 3, 2019 18:49 — forked from manastungare/css-compress.php
Fix space removal so that it doesn't break space-separated values where the developer used more than one space to separate values.
<?php
/**
* On-the-fly CSS Compression
* Copyright (c) 2009 and onwards, Manas Tungare.
* Creative Commons Attribution, Share-Alike.
*
* In order to minimize the number and size of HTTP requests for CSS content,
* this script combines multiple CSS files into a single file and compresses
* it on-the-fly.
*