Skip to content

Instantly share code, notes, and snippets.

View nixon1333's full-sized avatar
Moving Fast

Ashraful Islam Nixon nixon1333

Moving Fast
View GitHub Profile
@nixon1333
nixon1333 / spintax.php
Created October 10, 2015 08:17 — forked from irazasyed/spintax.php
PHP: Text Spinner Class - Nested spinning supported.
<?PHP
/**
* Spintax - A helper class to process Spintax strings.
* @name Spintax
* @author Jason Davis - https://www.codedevelopr.com/
* Tutorial: https://www.codedevelopr.com/articles/php-spintax-class/
*/
class Spintax
{
public function process($text)
@nixon1333
nixon1333 / pagination.php
Last active December 2, 2015 04:28
pagination
<?php if ((ceil($usersTotal / $perPage)) >= 2) { ?>
<ul class="pagination pagination-sm no-margin pull-right">
<?php if ($currentPage != 1): ?>
<li>
<a href="<?php echo base_url() ?>super/users_list">&laquo;</a>
</li>
<?php endif; ?>
@nixon1333
nixon1333 / email_domain.php
Created November 6, 2014 10:43
simple solution for extracting domain name in php
<?php
$email = 'nixon@png.com.au';
//get the domain here
$domain = array_pop(explode('@', $email));
?>
<html>
<body>
Welcome <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?>
</body>
</html>
<html>
<body>
<form action="result.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>
</body>
<?php
/* The loop */
if ( get_post_gallery() ) :
$gallery = get_post_gallery( $post, false );
?>
<div class="sliderss">
<a href="javascript:" class="pera-close"></a>
<?php
/* Loop through all the image and output them one by one */
@nixon1333
nixon1333 / AdminController.php
Created September 2, 2014 06:32
phalcon - model join query
$robots = Category::query()
->columns(array('Category.id', 'Category.cate_name', 'Tags.tag_name'))
->join('Tags', 'Category.id = Tags.tag_ref_id')
->execute();
@nixon1333
nixon1333 / errorController.php
Created August 31, 2014 06:37
phalcon framework: pick any view from any controller
//pick the 404 page from view folder
$this->view->pick('404/404');
@nixon1333
nixon1333 / resource.php
Created August 27, 2014 12:57
load css,js,image in phalcon
<?php echo Phalcon\Tag::stylesheetLink("css/local.css"); ?>
<?php echo Phalcon\Tag::image("img/stsllc_logo.png");?>
<?php echo Phalcon\Tag::javascriptInclude("js/jquery-1.10.2.min.js");?>