Skip to content

Instantly share code, notes, and snippets.

View j3j5's full-sized avatar
🤷‍♂️

Julio J. j3j5

🤷‍♂️
View GitHub Profile
<?php
/**
* routes.php would be something like:
*
* Route::get('/my/path/{id}', ['as' => 'ExamplePath', 'uses' => 'ExampleController@getPath']);
*/
// Get the full URL from the current request --> http://example.com/my/path/1
request()->url();
ack -l 'TEXTOFIND' --print0 | xargs -0 -n 1 sed -i -e 's/TEXTOFIND/REPLACEWITH/'
@j3j5
j3j5 / gist:8b3e48ccad746b90a54a
Last active November 16, 2023 15:11
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
@j3j5
j3j5 / prompt_answer.php
Created April 18, 2015 16:22
PHP snippet to prompt for an answer on the CLI.
function prompt_answer($exit = TRUE) {
$handle = fopen ("php://stdin","r");
$line = fgets($handle);
if(trim($line) !== 'y' && !empty(trim($line))) {
fclose($handle);
if($exit) {
echo "ABORTING!" . PHP_EOL;
exit;
} else {
return FALSE;
@j3j5
j3j5 / tor_functions.php
Created April 13, 2015 14:34
How to tell if someone is coming from a Tor exit node
// http://www.irongeek.com/i.php?page=security/detect-tor-exit-node-in-php
public function IsTorExitPoint(){
if(gethostbyname(ReverseIPOctets($_SERVER['REMOTE_ADDR']).".".$_SERVER['SERVER_PORT'].".".ReverseIPOctets($_SERVER['SERVER_ADDR']).".ip-port.exitlist.torproject.org")=="127.0.0.2") {
return true;
} else {
return false;
}
}
private function ReverseIPOctets($inputip){