Skip to content

Instantly share code, notes, and snippets.

View vishnu1991's full-sized avatar
🎯
Focusing

Vishnu vishnu1991

🎯
Focusing
View GitHub Profile
@vishnu1991
vishnu1991 / watermark.php
Last active January 24, 2017 09:33
Add watermark to jpg images php
<?php
$bg_img='bg.jpg'; //path to background (JPG ext)
$logo_img='logo.png'; // path to logo (PNG ext.)
list($width_of_bg, $height_of_bg) = getimagesize($bg_img); // to calculate background image width and height
list($width_of_logo, $height_of_logo) = getimagesize($logo_img); //to calculate logo image width and height
//for bottom right
$logo_loc_width=$width_of_bg-$width_of_logo;
$logo_loc_height=$height_of_bg-$height_of_logo;
@vishnu1991
vishnu1991 / facebook-messenger-bot.php
Created December 11, 2016 19:35 — forked from remmel/facebook-messenger-bot.php
Basic example of a Facebook Messenger Bot
<?php
// parameters
$hubVerifyToken = 'TOKEN123456abcd';
$accessToken = "xxx";
// check token at setup
if ($_REQUEST['hub_verify_token'] === $hubVerifyToken) {
echo $_REQUEST['hub_challenge'];
exit;
}