Skip to content

Instantly share code, notes, and snippets.

View azeemhassni's full-sized avatar

Azeem Hassni azeemhassni

View GitHub Profile
@azeemhassni
azeemhassni / cff.js
Created November 5, 2014 13:09
Conditional Form Fields
jQuery(function($){
// Using : data-conditional='.currently-working;No;hide' data-default-display='none'
// Change Default status
$('[data-default-display]').each(function(){
if($(this).attr('data-default-display') == 'none') {
$(this).css("display","none");
} else {
@azeemhassni
azeemhassni / decode_url_formed_query.php
Last active September 7, 2017 09:53
Decode URL formed query
<?php
/**
* Decode URL formed strings
* @param $string
* @return array
* @author Azeem Hassni <http://azeemhassni.com>
*/
function decode_query($string) {
$vars = explode('&',$string);
$return = array();
@azeemhassni
azeemhassni / countries_array.php
Last active September 10, 2021 13:17
List Of All Countries PHP Array
<?php
$countries = array(
'Afghanistan' => 'Afghanistan',
'Albania' => 'Albania',
'Algeria' => 'Algeria',
'Armenia' => 'Armenia',
'Australia' => 'Australia',
'Austria' => 'Austria',
'Azerbaijan' => 'Azerbaijan',
@azeemhassni
azeemhassni / Gulpfile.js
Created November 1, 2015 14:24
Themes Gulpfile
/**
* Almost every project of mine shares the same gulp file.
* that's why i crated a gist for it.
*
* */
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
minify = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
@azeemhassni
azeemhassni / Package.json
Created November 1, 2015 14:25
Themes Package.json for node dependencies
{
"devDependencies": {
"gulp": "~3.9.0",
"gulp-autoprefixer": "~2.3.1",
"gulp-concat": "~2.6.0",
"gulp-minify": "0.0.5",
"gulp-minify-css": "~1.2.1",
"gulp-postcss": "~6.0.1",
"gulp-rename": "~1.2.2",
"gulp-ruby-sass": "~1.4.0",
@azeemhassni
azeemhassni / cashier.php
Created April 16, 2016 18:59 — forked from Braunson/cashier.php
Extending the Laravel package Cashier for creating an customer without a credit card
<?php
namespace Acme\V1\Billing;
// BillableInterface.php
use Laravel\Cashier\BillableInterface as CashierInterface;
interface BillableInterface extends CashierInterface {
@azeemhassni
azeemhassni / ProductIndexer.php
Last active May 17, 2016 19:42
TNT Search Product Indexer Artisan Command
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use TeamTNT\TNTSearch\Facades\TNTSearch;
class ProductIndexer extends Command
{
/**
@azeemhassni
azeemhassni / ProductsController.php
Last active February 23, 2018 19:52
TNTSearch Products Controller File
<?php
namespace App\Http\Controllers;
use App\Http\Requests;
use App\Product;
use Illuminate\Http\Request;
use TeamTNT\TNTSearch\Facades\TNTSearch;
class ProductsController extends Controller
<?php
# include this file in theme's functions.php
namespace Timber {
/**
* Proxy \get_post_meta to ACF get_field function
*
* @param $id
@azeemhassni
azeemhassni / nationalities.json
Last active July 3, 2019 18:35
Nationalites List in JSON format
{
"afghan": "Afghan",
"albanian": "Albanian",
"algerian": "Algerian",
"american": "American",
"andorran": "Andorran",
"angolan": "Angolan",
"antiguans": "Antiguans",
"argentinean": "Argentinean",
"armenian": "Armenian",