Skip to content

Instantly share code, notes, and snippets.

View aufa's full-sized avatar

NAWA aufa

View GitHub Profile
@aufa
aufa / MaxmindGeoIPCountryWhois.sql
Last active May 15, 2020 16:55
Import MAXMIND GEOLITE COUNTRY csv format into mysql .
--
-- this sql structure is for knowledgebase or educational only.
-- please do this on your localhost first before ypu test on your server
--
-- @author : awan
--
-- github : https://github.com/aufa/
--
-- @description this sql is for importing the MaxminD GeoLite Country to mysql data
-- first! we must download the csv format on maxmind developer site :http://dev.maxmind.com/geoip/legacy/geolite/
@aufa
aufa / mysql_backup_import.php
Last active April 23, 2021 23:31
PHP function to backup and import database using MYSQLI
<?php
/**
* @author awan < nawa (at) yahoo (dot) com >
*
*/
/**
* Function to build SQL /Importing SQL DATA
*
@aufa
aufa / index.php
Last active August 13, 2016 13:05
Determine Base Url On PHP Scripts www.inforiatif.com
<?php
/**
* This is index main file
* Base URL helper
* @author awan <http://www.inforiatif.com>
* artcile : http://www.inforiatif.com/cara-menentukan-url-base-domain-di-php
*/
/* ------------------------------------------------------------------------------------------------------ \
HELPER
@aufa
aufa / util.js
Last active September 15, 2016 01:23
Minimal Helper Javascript Utility
/*! Util JS
* Small File javascript function
* collection Without jQuery as User Authentication Helper
* @author awan <nawa (at) yahoo (dot) com>
*
-------------------------------- */
/**
* global zxcvbn
* Get scores of password meter
@aufa
aufa / Filter.php
Created December 28, 2015 04:35
PHP Filter Helper
<?php
/**
* HTML Output Filter
* @author awan <nawa@yahoo.com>
*/
/**
* Entities the Multibytes string
*
* @param string $string the string to detect multibytes
/**
* Minify CSS
* @param string css text
* @return sting minified css text
* @author awan <nawa@yahoo.com>
*/
function minifyCSS(text)
{
// check if css is string values
if (typeof text != 'string') {
### Keybase proof
I hereby claim:
* I am aufa on github.
* I am nawa (https://keybase.io/nawa) on keybase.
* I have a public key whose fingerprint is 8697 D389 2DFC 5690 E501 B237 F005 9FF1 26BF 7E64
To claim this, I am signing this object:
@aufa
aufa / MY_Config.php
Last active April 14, 2019 19:00
Prevent Visitor Accessed Direct Controller & Fix Main Url on Code Igniter config base url not set
<?php
/**
* Hackie of CI 3 Core URL Fix Sanitized
* Automation detect base url
* @pentagonal
*/
if (!class_exists('CI_Config')) {
return;
}
@aufa
aufa / .htaccess
Last active June 9, 2016 11:14
Upload to your directory that not allowed to exec behaviour script (apache only)
# Deny First
Deny from all
# Does not allow access executable files
# Allow only if not an executable / static resource
# that allow to be access
# note :
# ?i: = hat means incase sensitive
# (?!( = start except of current regex
# Below setting is affected to :
@aufa
aufa / ExamDB.php
Last active September 13, 2016 19:53
Database Object Class Example
<?php
/**
* $db = ExamDB::create('driver', [
* 'dbuser' => 'user', ------. For Sqlite allowed empty
* 'dbpass' => 'pass', ------.
* 'port' => 3306, ------ // allowed empty to use default port
* 'dbname' => 'database_name',
* 'attributes' => [
* PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC // PDO Attribute
* ]