Skip to content

Instantly share code, notes, and snippets.

View MindSculpt's full-sized avatar
💭
Design tokens

Michael Becker MindSculpt

💭
Design tokens
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mindsculpt on github.
  • I am michaelbecker (https://keybase.io/michaelbecker) on keybase.
  • I have a public key ASBtPyOV_DnM7zy0Neecn1G6EVHeqQVJkC_-QBvob8Fh2wo

To claim this, I am signing this object:

@MindSculpt
MindSculpt / rate-limiting-concept.php
Created July 11, 2016 18:49
Rate limiting concept approach representing an alternate method to IP blocking or user registration to keep spam voting under control. This is a loose outline of how you might accomplish this. Requires MySQL database and MVC project structure.
<?php
/*
Rate limiting concept approach. Determines if rating is valid and returns JSON response to an AJAX call to this class. Uses Fat-Free PHP framework syntax.
This does not guarantee 100% unique vote submissions. It represents an alternate method to IP blocking or user registration to keep spam voting under control. It provides a loose outline of how you might approach this.
Status codes are completely custom for use in testing only.
Based loosely on http://blog.thelonepole.com/2013/03/preventing-spam-votes-in-online-polls/
@MindSculpt
MindSculpt / StripeController.php
Created July 11, 2016 17:25
Stripe webhook class example for use with Fat-Free Framework. Basic approach highlighted; add/edit to fit your project needs.
<?php
/**
* Stripe webhook class
* This is not intended to be plug-and-play; it's intended to be a general outline for how to handle stripe subscription hooks.
* You'll need to change variables, database field names, and specific stripe behavior to match your project needs
*
* @author Michael Becker <michael.becker@mindsculpt.com>
*/
namespace Controllers;