Skip to content

Instantly share code, notes, and snippets.

View mepawan's full-sized avatar

Pawan Developers mepawan

View GitHub Profile
@mepawan
mepawan / compress.php
Created May 18, 2019 14:22
CodeIgniter Compre Output
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
function compress()
{
$CI =& get_instance();
$buffer = $CI->output->get_output();
$search = array(
'/\>[^\S ]+/s',
'/[^\S ]+\</s',
function number_format(number, decimals, dec_point, thousands_sep) {
//console.log(number);
// http://kevin.vanzonneveld.net
// + original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + bugfix by: Michael White (http://getsprink.com)
// + bugfix by: Benjamin Lupton
// + bugfix by: Allan Jensen (http://www.winternet.no)
// + revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
// + bugfix by: Howard Yeend
<?php
/**
* PWN | File Manager
* Pawan Developers
* http://100utils.com
* https://github.com/mepawan/pwn-file-manager
*/
// Default language
$lang = 'en';
@mepawan
mepawan / country_list_with_3char_code.php
Created July 3, 2017 09:29
country list with 3 char ISO 3166 Code
$iso_array = array(
'ABW'=>'Aruba',
'AFG'=>'Afghanistan',
'AGO'=>'Angola',
'AIA'=>'Anguilla',
'ALA'=>'Åland Islands',
'ALB'=>'Albania',
'AND'=>'Andorra',
'ARE'=>'United Arab Emirates',
'ARG'=>'Argentina',
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- country list -->
<string-array name="data000">
<item name="code">+93</item>
<item name="country">Afghanistan</item>
<item name="iso">AF</item>
<item name="flag">@drawable/afghanistan</item>
</string-array>
{
"countries": [
{
"code": "+7 840",
"name": "Abkhazia"
},
{
"code": "+93",
"name": "Afghanistan"
},
@mepawan
mepawan / country_code2calling_code
Created July 2, 2017 03:11
S function to converts "Country Code" (ISO3) to Telephone "Calling Code"
function country_iso3_to_country_calling_code(country_iso3) {
if(country_iso3 == 'AFG') return '93';
if(country_iso3 == 'ALB') return '355';
if(country_iso3 == 'DZA') return '213';
if(country_iso3 == 'ASM') return '1684';
if(country_iso3 == 'AND') return '376';
if(country_iso3 == 'AGO') return '244';
if(country_iso3 == 'AIA') return '1264';
if(country_iso3 == 'ATA') return '672';
if(country_iso3 == 'ATG') return '1268';
@mepawan
mepawan / GoogleMapInfowindowOpenAutomatically
Created April 13, 2017 09:53
InfoWindow automatically open on page load
var infoWindow = null;
function initialize()
{
infoWindow = new google.maps.InfoWindow();
var windowLatLng = new google.maps.LatLng(43.25,-68.03);
infoWindow.setOptions({
content: "<div>This is the html content.</div>",
position: windowLatLng,
});
infoWindow.open(map);
<?php
function _require_all($directory, $exclude_folders = array(), $exclude_extensions = array() ) {
if(is_dir($directory)) {
$scan = scandir($directory);
unset($scan[0], $scan[1]); //unset . and ..
foreach($scan as $file) {
if(is_dir($directory."/".$file)) {
if(in_array($file,$exclude_folders)){
continue;