Skip to content

Instantly share code, notes, and snippets.

<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\URL;
class PaymentController extends Controller {
public function __construct()
try {
$charge = \Stripe\Charge::create(array(
"amount" => $message->price * 100,
"currency" => "gbp",
// "source" => $connected_customer->id,
"source" => $token->id,
), array("stripe_account" => $message->user->stripe_merchant_id));
} catch (\Stripe\Error\RateLimit $e) {
return [];
} catch (\Stripe\Error\InvalidRequest $e) {
package com.curiouslyodd.mineclash.events;
import java.util.List;
import java.util.Set;
import com.curiouslyodd.mineclash.items.ItemMiscBloodDiamond;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
@joeyemery
joeyemery / homestead.yaml
Created April 7, 2017 16:15
Homestead.yaml
---
ip: "192.168.10.10"
# memory: 2048
memory: 1024
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
$data = [
'intro' => [
'title' => 'Molekula Group have been busy recently.',
'content' => 'We’ve moved our headquarters over 300 miles from Gillingham, Dorset to Newcastle-Upon-Tyne, in the heart of North-East England. We’ve also acquired Sherman Chemicals, another Gillingham based chemical supplier, solidifying our status as one of the UK\'s market leaders in our industry. We’ve also recently dramatically increased the capacity of our operations in Germany, allowing us to hold stock in mainland Europe.',
],
'news' => [
[
'title' => 'Sherman Chemicals Acquisition',
'content' => 'Sherman Chemicals, a company that’s been in operation since 1958, is now 100% owned by the Molekula Group. This has directly expanded the production and contract manufacture side of the business, allowing us to offer our existing customers a much wider range of products
```` /*$output .= "<script>
$(function() {
var orderId = " . $order->getOriginalQuote()->getId() . ";
$.ajax({
url: 'http://api.molekula.com/third-party/v1/pickingslip-scanner/' + orderId + '/images',
type: 'GET',
dataType: 'json'
})
.done(function(data) {
@joeyemery
joeyemery / gist:ac2032a65921087ee402
Created June 29, 2015 18:05
At least X decimal places.
public static function forceDecimals($num, $dec = 2)
{
for ($x=0;$x<=5;$x++) {
if ($num == $tmp_num=sprintf("%01.".($dec+$x)."f",$num)) {
return $tmp_num;
}
}
return $num;
}
$(document).ready(function() {
$('button#show').on('click', function() {
£('p').show();
});
$('button#hide').on('click', function() {
$('p').hide();
});
});
@joeyemery
joeyemery / rpl.js
Created April 28, 2015 14:43
Recursive Pedophile Loop
$(document).ready(function() {
RecursivePedofileLoop();
});
// RPL Function.
function RecursivePedofileLoop()
{
// Actual code to go here.
// Call the loop again to make it infinitely recursive.
@joeyemery
joeyemery / gist:07cd18f467a011226574
Created February 4, 2015 12:32
Map Example.json
{ "height":22,
"layers":[
{
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5909, 5910, 5911, 5912, 5909, 5910, 5911, 5912, 5909, 5910, 5911, 5912, 5909, 5910, 5911, 5912, 5909, 5910, 5911, 5912, 0, 0, 5941, 5942, 5943, 5944, 5941, 5942, 5943, 5944, 5941, 5942, 5943, 5944, 5941, 5942, 5943, 5944, 5941, 5942, 5943, 5944, 0, 0, 5973, 5974, 5975, 5976, 5973, 5974, 5975, 5976, 5973, 5974, 5975, 5976, 5973, 5974, 5975, 5976, 5973, 5974, 5975, 5976, 0