Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Vishnu vishnu1991

🎯
Focusing
View GitHub Profile
@vishnu1991
vishnu1991 / watermark.php
Last active Jan 24, 2017
Add watermark to jpg images php
View watermark.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 Dec 11, 2016 — forked from remmel/facebook-messenger-bot.php
Basic example of a Facebook Messenger Bot
View facebook-messenger-bot.php
<?php
// parameters
$hubVerifyToken = 'TOKEN123456abcd';
$accessToken = "xxx";
// check token at setup
if ($_REQUEST['hub_verify_token'] === $hubVerifyToken) {
echo $_REQUEST['hub_challenge'];
exit;
}