Skip to content

Instantly share code, notes, and snippets.

View amin007's full-sized avatar
🏠
Working from home

amin007 amin007

🏠
Working from home
View GitHub Profile
@nawawi
nawawi / check_email.php
Created July 6, 2015 17:59
check email
<?php
function _check_email($email, $strict = false) {
if ( filter_var($email, FILTER_VALIDATE_EMAIL) ) {
if ( $strict && function_exists("getmxrr") ) {
list($prefix, $domain) = split("@",$email);
return @getmxrr($domain, $maxhost);
}
return true;
}
return false;
@nawawi
nawawi / rubber stamp
Created May 26, 2015 19:09
try create rubber stamp / company stamp
<?php
$img = imagecreatetruecolor(200, 200);
// allocate some colors
$white = imagecolorallocate($img, 255, 255, 255);
$red = imagecolorallocate($img, 255, 0, 0);
$green = imagecolorallocate($img, 0, 255, 0);
$blue = imagecolorallocate($img, 0, 0, 255);
$blue1 = imagecolorallocate($img, 102, 104, 230);
@nawawi
nawawi / dump_object
Created May 20, 2015 12:43
dump_object
function dump_object(array) {
var pad_char = ' ', pad_val = 2;
function repeat_char(len, pad_char) {
var str = '';
for (var i = 0; i < len; i++) {
str += pad_char;
}
return str;
};
@kidino
kidino / gist:5562087
Last active December 17, 2015 05:59
Modified captcha helper for CodeIgniter. Add this as /application/helpers/MY_captcha_helper.php - random spacing between letters - random colors - set font_size
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
@azrad
azrad / Autoload.php
Created February 5, 2013 00:59
How I autoload my models
<?php
spl_autoload_register('seed_autoload');
function seed_autoload($class_name) {
$the_class_name = from_camel_case($class_name);
if(file_exists(MODEL_DIR .'/' .$the_class_name .'.class.php'))
require_once MODEL_DIR .'/' .$the_class_name .'.class.php';
}