Skip to content

Instantly share code, notes, and snippets.

View jake-yeg's full-sized avatar

Jake jake-yeg

View GitHub Profile
<?php
/**
* PHPMailer simple contact form example.
* If you want to accept and send uploads in your form, look at the send_file_upload example.
*/
//Import the PHPMailer class into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
require '../vendor/autoload.php';
if (isset($_POST['to'])) {
$err = false;
<form action="/charge" method="post" id="payment-form">
<div class="card-errors"></div>
<div class="form-row">
<label for="cardNumber">
<span>Card number</span>
</label>
<div id="cardNumber"></div>
</div>
<?php
class GetPut{
private $values = [];
public function getVal($key, $timestamp = null){
if($timestamp !== null && !empty($key)){
foreach($this->values[$key] as $value){
def retrieveAll(placeholder = nil)
results = Stripe::Charges.list(limit: 100, starting_after: placeholder)
for result in results.data
puts result.id
end
if results.has_more == false
#we're all done
return
@jake-yeg
jake-yeg / charge.php
Created May 17, 2017 01:10
Coupon Recipe - PHP
Managing coupons on the server
----------------
<?php
$private_key = 'sk_test_xxxxx';
$amount = 500;
$final_amount = '';
account = Stripe::Account.retrieve("acct_19Q9DhJ5O9c4mtR7")
account.external_accounts.create(
external_account: [
object: "bank_account",
account_number: 000000000000,
currency: 'USD',
country: 'US',
routing_number: 1111111,
...
]
@jake-yeg
jake-yeg / a.php
Last active January 7, 2019 22:07
<?php
require_once('stripephp/init.php');
//Load up the APK's.
$files = array_diff(scandir(dirname(__FILE__) . '/apks'), array('..', '.'));
//Decompile each, and grep for sk_live
foreach($files as $file){
208.100.26.237 - - [10/Feb/2017:13:18:48 +0000] "GET / HTTP/1.1" 400 280
"() { :;}; echo; echo \x223056d3f730239257dc88e7a06768d49a\x22" "() { :;}; echo; echo \x223056d3f730239257dc88e7a06768d49a\x22"
<?php
/*
Challenge 2: Implement AnswerInterface and get Question to echo "4".
*/
class Question
{
public function __construct(AnswerInterface $answer)
{
echo "What is 2 + 2?\n";
$answer = $answer->get()->the()->answer();
<?php
$Directory = new RecursiveDirectoryIterator('path/to/project/');
$Iterator = new RecursiveIteratorIterator($Directory);
$array = new RegexIterator($Iterator, '/^.+\.jpg$/i', RecursiveRegexIterator::GET_MATCH);
foreach($array as $arr){
if(preg_match('/.*[0-9].(?:jpg)/',$arr) || strpos($arr,'coverleft') !== false || strpos($arr,'coverright') !== false){
echo $arr . ' Was Found ' . PHP_EOL;