Skip to content

Instantly share code, notes, and snippets.

View kingpabel's full-sized avatar

Imtiaz Ahmed kingpabel

View GitHub Profile
<?php
//image slider of hasinhayder
https://github.com/hasinhayder/image-slide-with-single-img
//wordpress plugin
http://wpplugindirectory.org/
// if need add timestamp or userinfo by default have to use cakephp behaviors
//for theme add a line in appController and theme name in bootstrap.php
<?php
$path = $_POST['image']['name'];
$ext = pathinfo($path, PATHINFO_EXTENSION);
list( $width, $height ) = getimagesize( $_POST['imageInfo']['tmp_name'] );
$newwidth = 100;
$newheight = 100;
$thumb = imagecreatetruecolor( $newwidth, $newheight );
if ( $ext == 'png' ) {
$source = imagecreatefrompng( $_POST['imageInfo']['tmp_name'] );
imagecopyresized( $thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height );
//for normal validation which we will use before in laravel controller need to use 2 file in controller
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Input;
//for greater case return Redirect::back() need to use this file in controller
use Illuminate\Support\Facades\Redirect;
//how to use eloquent outside laravel
https://www.youtube.com/watch?v=L0g9ka5qaCc
<?php
require "../bootstrap.php";
<?php
class Paypal{
public $apiContext;
public function __construct() {
$this->apiContext = new \PayPal\Rest\ApiContext(
new \PayPal\Auth\OAuthTokenCredential(
'AfdxlpJ5HaMVw3h1vxzA5Y3dgg3fcCQW_zj7ngtXOl2YSFvY1hX8fbBraNt-CimMrr7VNMG8w2FsOw8Q', // ClientID
<form action="https://sandbox.paypal.com/uk/cgi-bin/webscr" method="post" name="paypal" id="paypal">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="test@yahoo.com">
<input type="hidden" name="item_name" value="Test Item">
<input type="hidden" name="item_number" value="5">
<input type="hidden" name="amount" value="5">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="AU">
<script src="https://gist.github.com/kingpabel/21c8c634cbe60ebfbfe1.js"></script>
//for clear composer cache
composer clearcache
composer clear-cache
rm -rf ~/.composer/cache*
//increase composer timeout
export COMPOSER_PROCESS_TIMEOUT=600
COMPOSER_PROCESS_TIMEOUT=2000 composer install
<script>
//app defined
var myApp = angular.module("myApp", []);
//multiple controller in a single app
myApp.controller("studentController", function($scope){
$scope.student = {
firstName: "Mahesh",
lastName: "Parashar",
fullName: function() {
return $scope.student.firstName + " " + $scope.student.lastName;
"require":{
"mpdf/mpdf": "dev-master"
}