Skip to content

Instantly share code, notes, and snippets.

View imanilchaudhari's full-sized avatar
💻
Learning Dart On Flutter

Anil Chaudhari imanilchaudhari

💻
Learning Dart On Flutter
View GitHub Profile
<?php
namespace backend\widgets;
use yii\helpers\Html;
/**
* PageSize widget is an addition to the \yii\grid\GridView that enables
* changing the size of a page on GridView.
*
<?php
namespace backend\components;
class DiskStatus {
const RAW_OUTPUT = true;
private $diskPath;
<?php
namespace backend\helpers;
use Yii;
use yii\db\Query;
use yii\base\Object;
use SitemapPHP\Sitemap;
/**
*
* This is based on https://github.com/evert/sitemap-php/
<?php
namespace backend\components;
class XmlToJson {
public function Parse ($url) {
$fileContents= file_get_contents($url);
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);
$fileContents = trim(str_replace('"', "'", $fileContents));
$simpleXml = simplexml_load_string($fileContents);
@imanilchaudhari
imanilchaudhari / Browser.php
Created September 17, 2016 15:22
Getting clients browser information.
<?php
namespace backend\components;
/**
* File: Browser.php
* Typical Usage:
*
* $browser = new Browser();
* if( $browser->getBrowser() == Browser::BROWSER_FIREFOX && $browser->getVersion() >= 2 ) {
* echo 'You have FireFox version 2 or greater';
@imanilchaudhari
imanilchaudhari / Server setup for Ubuntu 16.04 on Digital Ocean.txt
Created October 3, 2016 11:04
Server setup for Ubuntu 16.04 on Digital Ocean
# Server setup for Ubuntu 16.04 on Digital Ocean
**The setup installs the following software:**
* Nginx
* MySQL
* PHP
* Node
* Composer
@imanilchaudhari
imanilchaudhari / AngularAsset.php
Created October 4, 2016 05:22
Yii2 advanced app angular
<?php
namespace backend\assets;
use yii\web\AssetBundle;
use yii\web\View;
/**
* Class AngularAsset
*/
class AngularAsset extends AssetBundle
{
public $sourcePath = '@bower/angular/';
<?php
namespace backend\components;
class FacebookDebugger
{
/*
* https://developers.facebook.com/docs/opengraph/using-objects
*
<?php
namespace backend\components;
/**
* File: Countires.php
* Last Modified: July 22nd, 2016
*
* Typical Usage:
*
* $countries = (new Countries())->getAll();
<?php
namespace backend\components;
class Nationalities
{
/**
* List all the nationalities as an array format.
*
* @param null
* @return array