Skip to content

Instantly share code, notes, and snippets.

View kingpabel's full-sized avatar

Imtiaz Ahmed kingpabel

View GitHub Profile
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
-- phpMyAdmin SQL Dump
-- version 2.11.7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 11, 2010 at 09:36 AM
-- Server version: 5.0.51
-- PHP Version: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
myApp.directive("scrollable", function() {
return function(scope, element, attrs) {
var container = angular.element(element);
container.bind("scroll", function(evt) {
if (container[0].scrollTop <= 0) {
alert('On the top of the world I\'m singing I\'m dancing.');
}
/*if (container[0].offsetHeight + container[0].scrollTop >= container[0].scrollHeight) {
alert('On the bottom of the world I\'m waiting.');
}*/
function displayPreview(files) {
var reader = new FileReader();
var img = new Image();
reader.onload = function (e) {
img.src = e.target.result;
img.onload = function () {
if(this.width != 622 || this.height != 400){
new PNotify({
title: 'Warning',
text: "That image size will not show a better view",
<script>
$("#recordVidoePublish").submit(function(event){
event.preventDefault();
var fd = new FormData();
fd.append('data', player.recordedData);
$.ajax({
url: "your/url.php",
type: "POST",
data: fd,
cache: false,
{{-- first use this directive in html --}}
<div ng-cloak>
{{ test }}
</div>
{{-- Then use this style in your page --}}
<style>
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
<?php
//first check is count variable exists and also count variable is not null
echo $count ?? $count ?? 10;
//output 10;
$count = 'data';
echo $count ?? $count ?? 10;
//output data;
<?php
//right way
function foo(): array {
return [];
}
var_dump(foo());
//wrong way
<?php
//right way
function test(int $a){
return $a;
}
var_dump(test(1));
//wrong way
<?php
//example
$array = [
[
'foo' => 5.5,
'bar' => 'abc'
],
[
'foo' => 7.7,
'bar' => 'xyz'