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 / 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 / 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 / README.md
Created November 19, 2015 05:24 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@nixon1333
nixon1333 / wkhtmltopdf.php
Created December 13, 2015 07:16
how to parse a secured file in php and make it available in pdf using wkhtmltopdf
//if expected template available in string formate
if($string1)
{
//write the expected template in a unique html file
write_file("uploads/$classId/Result-$classId-part$number.html", $string1);
//make the unique url for the html
$fileUrl = base_url()."uploads/$classId/Result-$classId-part$number.html";
//run exec funtion and fee the html link to wkhtml function with requed pdf link(unique)
exec('"C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe" '.$fileUrl. ' uploads/'.$classId.'/'.$number.".pdf");
//after execution remove the html file
@nixon1333
nixon1333 / print-file.html
Created January 4, 2016 07:50
print page demo
<style>
body {
}
table
{
width: 100%;
}
table,th,td
@nixon1333
nixon1333 / banglaNumber.php
Created February 20, 2016 10:20
Bangla number conversion from English
<?php
function toBangla ($str)
{
$convert = array (
'0' => '০',
'1' => '১',
'2' => '২',
'3' => '৩',
'4' => '৪',
'5' => '৫',
@nixon1333
nixon1333 / banglaNumber.js
Created February 22, 2016 09:53
English number to Bangla number convertion
function toBangla (str)
{
//check if the `str` is not string
if(!isNaN(str)){
//if not string make it string forcefully
str = String(str);
}
//start try catch block
try {
@nixon1333
nixon1333 / SendSmsCommand.php
Last active December 14, 2016 23:00
Simple CLI Command using Symfony
<?php
// this is the file structure of the command file.
// src/SmsBundle/Command/SendSmsCommand.php
namespace SmsBundle\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
//we need this to take inputs from the console.
use Symfony\Component\Console\Input\InputArgument;
@nixon1333
nixon1333 / .htaccess
Created December 30, 2016 16:13
301 redirect(all pages) to new Domain
Options +FollowSymLinks
RewriteEngine on
#here http://www.ainixon.me/rss/ is the new domain link where we want to redirect all our traffic.
RewriteRule (.*) http://www.ainixon.me/rss/ [R=301,L]