Skip to content

Instantly share code, notes, and snippets.

Avatar

Brenton Strine brentonstrine

View GitHub Profile
@brentonstrine
brentonstrine / api.php
Last active Jun 26, 2019 — forked from sroehrl/api.php
Concept of an API (for learning, not production)
View api.php
<?php
/* MOST SIMPLE API */
/*
* Add functions to class Methods
* currently, the script supports the call api.php/test
* */
// respond as JSON
View rockpaperscissors.js
// 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 Oct 1, 2016
Scroll through blocks of color while scrolling
View colorScroller.js
//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 Dec 3, 2019 — 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.
View css-compress.php
<?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.
*
You can’t perform that action at this time.