This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class GetPut{ | |
private $values = []; | |
public function getVal($key, $timestamp = null){ | |
if($timestamp !== null && !empty($key)){ | |
foreach($this->values[$key] as $value){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Managing coupons on the server | |
---------------- | |
<?php | |
$private_key = 'sk_test_xxxxx'; | |
$amount = 500; | |
$final_amount = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | |
... | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |