Skip to content

Instantly share code, notes, and snippets.

View i-tabu's full-sized avatar
😎

Tabu i-tabu

😎
View GitHub Profile
@i-tabu
i-tabu / getopt.php
Last active March 9, 2016 15:59
getopt - get options from params - example
#!/usr/bin/php
<?php
print "\nscript started\n";
//banner
//Usage:
//php your_script.php <server> <host> <db>
$banner = "Usage:\n";
$banner .= "php {$argv[0]} -s <server> -h <host> -d <db>\n";
$banner .= "Example:\n";
$banner .= "php your_script.php -s myserver.tabrez.me -h localhost -d mydb \n";
https://api.pepipost.com/api/web.send.rest?
api_key=yourapikey
&subject=rawurlencodeWeekly statement dated 1st Jan 2013")
&fromname=rawurlencode("Info Stats")
&[email protected]
&[email protected]
&X-APIHEADER="ACC123,SE2532"
&tags="AccountDeactivation, Verification"
&content=rawurlencode(" Email content here")
&[email protected],[email protected]
@i-tabu
i-tabu / Pepipost_sample_json_call.json.txt
Last active April 26, 2016 14:01
Pepipost Sample JSON Call
{
"api_key":"yourapikey",
"email_details":{
"fromname":"sender name",
"subject":"test email subject",
"from":"[email protected]",
"replytoid": "[email protected]",
"content":"<p>Hi [%NAME%], This is a test email sent using Pepipost JSON/Email API</p>"
},
"X-APIHEADER": ["ACC123","SE2532"],
@i-tabu
i-tabu / Pepipost_sample_output_success.json
Created March 18, 2016 12:23
Pepipost - sample of successful output
{"message":"SUCCESS","errorcode": "0" ,"errormessage":""}
@i-tabu
i-tabu / Pepipost_sample_output_error.json
Created March 18, 2016 12:34
Pepipost - sample of error output
{"message":"ERROR","errorcode": "0" ,"errormessage":""}
@i-tabu
i-tabu / Pepipost_sample_json_call_with_cc_bcc.json.txt
Last active March 18, 2016 12:43
Sample send call with CC & BCC
https://api.pepipost.com/api/mail.send.json?
&api_key=yourapikey
&to[][email protected]
&toname[]=Destination
&[email protected]
&ccname=CCDestination
&[email protected]
&bccname=BCCDestination
&subject=Example_Subject
&text=testingtextbody
---
swagger: "2.0"
info:
description: "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters."
version: "1.0.0"
title: "Swagger Petstore"
termsOfService: "http://swagger.io/terms/"
contact:
email: "[email protected]"
license:
@i-tabu
i-tabu / Pepipost_API_using_mandrill_SDK.php
Created April 26, 2016 16:34
Pepipost_API_using_mandrill_SDK
<?php
/**
* Steps to install Mandrill SDK
* curl -s http://getcomposer.org/installer | php
* php composer.phar require mandrill/mandrill
* Edit
* vendor/mandrill/mandrill/src/Mandrill.php
* //public $root = 'https://mandrillapp.com/api/1.0';
* public $root = 'https://api.pepipost.com/api/1.0';
*/
@i-tabu
i-tabu / ip_auth.php
Last active June 27, 2016 05:19
With the help of this static class, one can authenticate ip by providing, one or more allowed ips, ip pattern or ip CIDR.
<?php
/**
Usage:
IpAuth::doAuth(array(
'xxx.xxx.xxx.* ',
'yyy.yyy.yyy.* ',
'aaa.bbb.ccc.0/19',
'a.b.c.d',
));
<?php
/**
CREATE TABLE `invitees` (
`email` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`sent` tinyint(1) NOT NULL DEFAULT '0',
`remarks` text NOT NULL,
`group` varchar(15) DEFAULT NULL,
`lastname` varchar(255) DEFAULT NULL,