Skip to content

Instantly share code, notes, and snippets.

Avatar

Pawan Developers mepawan

View GitHub Profile
@mepawan
mepawan / compress.php
Created May 18, 2019
CodeIgniter Compre Output
View compress.php
<?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',
View number_format JS
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
View pwn file manager
<?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 Jul 3, 2017
country list with 3 char ISO 3166 Code
View country_list_with_3char_code.php
$iso_array = array(
'ABW'=>'Aruba',
'AFG'=>'Afghanistan',
'AGO'=>'Angola',
'AIA'=>'Anguilla',
'ALA'=>'Åland Islands',
'ALB'=>'Albania',
'AND'=>'Andorra',
'ARE'=>'United Arab Emirates',
'ARG'=>'Argentina',
View android_ready_country_list
<?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>
View country_calling_codes_json
{
"countries": [
{
"code": "+7 840",
"name": "Abkhazia"
},
{
"code": "+93",
"name": "Afghanistan"
},
@mepawan
mepawan / country_code2calling_code
Created Jul 2, 2017
S function to converts "Country Code" (ISO3) to Telephone "Calling Code"
View country_code2calling_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 Apr 13, 2017
InfoWindow automatically open on page load
View GoogleMapInfowindowOpenAutomatically
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);
View RequireAll.php
<?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;