Skip to content

Instantly share code, notes, and snippets.

View RichardB122's full-sized avatar

Richard Bimmer RichardB122

View GitHub Profile
@RichardB122
RichardB122 / recaptcha.php
Created November 5, 2016 01:41
A simple implementation of Google's reCAPTCHA in PHP. Use this to simply check if the CAPTCHA was correctly solved by the user. Make sure you replace the key value with your secret key.
<?php
// get reCAPTCHA verification code
if (isset($_POST['g-recaptcha-response'])) $captcha = $_POST['g-recaptcha-response'];
// check with Google's servers if the captcha is valid
$captchaSuccess = false;
if (isset($captcha)) {
$captchaKey = 'YOUR SECRET KEY';
$captchaURL = 'https://www.google.com/recaptcha/api/siteverify?secret=';
$response = json_decode(file_get_contents($captchaURL . $captchaKey . '&response=' . $captcha));
@RichardB122
RichardB122 / ExperienceManager.java
Created June 20, 2015 06:28
A simple and easy to use class that can get and set a player's total experience points in Minecraft. This is based off the Bukkit API. The determines this with a mathematical formula based off the player's current level and their progress towards the next one.
/*
AUTHOR: Dev_Richard (https://www.spigotmc.org/members/dev_richard.38792/)
DESC: A simple and easy to use class that can get and set a player's total experience points.
Feel free to use this class in both public and private plugins, however if you release your
plugin please link to this gist publicly so that others can contribute and benefit from it.
*/
import java.math.BigDecimal;
import java.util.List;