Skip to content

Instantly share code, notes, and snippets.

View abdullahbutt's full-sized avatar

Abdullah Butt abdullahbutt

  • Petersberg, Deutschland
View GitHub Profile
@abdullahbutt
abdullahbutt / jquery ui autocomplete ajax
Created October 13, 2016 10:19
jquery ui autocomplete ajax
//---------------------------------------------------- AJAX Search Company Name ---------------------------------------------------
$( "#company_by_name" ).autocomplete({
source: function( request, response ) {
$.ajax( {
data: {
keyword: request.term // This will add "?keyword=typedValue" in below url
},
url: "/datamining/public/ajax_comp",
method: "get",
@abdullahbutt
abdullahbutt / js search all urls in string.html
Last active August 15, 2016 12:52
search all urls in string
<!DOCTYPE html>
<html>
<head>
<title>regex test</title>
</head>
<body>
<script type="text/javascript">
var regex = /((http|https)\:\/\/)?[a-zA-Z0-9\\/\?\:@\-_=#]+\.([a-zA-Z0-9\&\.\/\?\:@\-_=#])+/g ;
str = "lorem ipsum www.google.com lorem ipusm dolor http://yahoo.com/something ... abc.com .. ... hearted. eu.com com.";
var myArray = str.match(regex);
@abdullahbutt
abdullahbutt / CI_phpStorm.php
Created December 2, 2015 09:05 — forked from topdown/CI_phpStorm.php
Code Completion for CodeIgniter in phpStorm
<?php die('This file is not really here!');
/**
* ------------- DO NOT UPLOAD THIS FILE TO LIVE SERVER ---------------------
*
* Implements code completion for CodeIgniter in phpStorm
* phpStorm indexes all class constructs, so if this file is in the project it will be loaded.
* -------------------------------------------------------------------
* Drop the following file into a CI project in phpStorm
* You can put it in the project root and phpStorm will load it.
@abdullahbutt
abdullahbutt / laravel update error solution
Created May 13, 2015 01:58
laravel update error solution
laravel update error solution
Simply delete storage/framework/compiled.php and rerun composer install/composer update.
@abdullahbutt
abdullahbutt / php time difference am and pm
Created February 13, 2015 13:48
php time difference am and pm
//php time difference am and pm
$startTime=6:45 PM;
$endTime=7:00 PM;
var_dump($endTime );
var_dump($endTime );
$d1= strtotime($startTime);
var_dump($d1);
$d2= strtotime($endTime);
var_dump($d2);
@abdullahbutt
abdullahbutt / jquery phone mask
Created February 11, 2015 10:08
jquery phone mask
jQuery(function($) {
$.mask.definitions['~']='[+-]';
$('#phone').mask('(999) 999-99999999');
$("#ssn").mask("999-99-9999");
});
@abdullahbutt
abdullahbutt / laravel database settings with and without homestead
Created February 11, 2015 07:13
laravel 5 database settings with and without homestead
//laravel database settings with and without homestead
/* below is standard mysql settings for Homestead
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'comments'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated for Laravel 4.2.16 on 2014-12-24.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
<?php
function getWorkingDays($startDate,$endDate,$holidays) {
// do strtotime calculations just once
$endDate = strtotime($endDate);
$startDate = strtotime($startDate);
//The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24
//We add one to inlude both dates in the interval.
$days = ($endDate - $startDate) / 86400 + 1;
@abdullahbutt
abdullahbutt / how to install mongo in sails.js
Last active August 29, 2015 14:10
how to install mongo in sails.js
How to install mongo in sails.js
First Install Mongo DB in your Operationg system.
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/
Getting Started with MongoDB