Skip to content

Instantly share code, notes, and snippets.

@Aramics
Aramics / MY_Form_validation.php
Created October 2, 2019 07:16
Codeigniter is_unique for multiple fields
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Form_validation extends CI_Form_validation {
protected $CI;
public function __construct($rules = array())
{
parent::__construct($rules);
$this->CI =& get_instance();
@Aramics
Aramics / networkProvider.php
Created July 21, 2019 06:25
Check the Network Provider (MTN, GLO, 9Mobile/Etisalat, Airtel) of Any Mobile number or Phone number
/**
* Author: Aramics
* Function: Check the Network Provider (MTN, GLO, 9Mobile/Etisalat, Airtel) of Any Mobile number or Phone number
* Return: $return; empty when length is not valid.
* Network code e.g 01 when @param $returnTitle is false else
* return Network title by default e.g "MTN"
*
* Function is used in validating a number to ensure user have choosen right network
*
@Aramics
Aramics / validatePin.js
Last active July 21, 2019 06:03
Snippet to Validate a Pin code or Password for repetition, matched length and weak pin codes ( nested integers)
/**
*
* Author: aramics
* Function to validate pin code or password
* Return boolean;
* @param pin string to validate as pin e.g "9358"
* @param norepeat boolean: check if pin contain repetitive number
* @param noserial boolean: check if pin contain nexted integer e.g 12 or 34
* @param pinLength int: length of the pin
* validatePin("9358",4,false,true)