Skip to content

Instantly share code, notes, and snippets.

View rintoug's full-sized avatar

Rinto George rintoug

View GitHub Profile
@rintoug
rintoug / Post.php
Last active May 3, 2021 15:34
Ajax Infinite Scroll Pagination in Codeigniter [Tutorial : https://www.tutsplanet.com/ajax-infinite-scroll-pagination-in-codeigniter/]
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
//Location: application/controllers/Post.php
class Post extends CI_Controller {
public $perPage = 3;
public function index()
{
@rintoug
rintoug / gitflow-breakdown.md
Created March 22, 2021 08:53 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

#!/bin/bash
# Customers
php aritsan import:customers
echo Customers Done
# Products
php aritsan import:products
echo Products Done
# Orders
counter=1
while [ $counter -le 3 ]
@rintoug
rintoug / upload.php
Created May 28, 2017 07:48
Connect and Handle Files in FTP Server using PHP
<?php
// FTP server details
$ftpHost = 'ftp.host.com';
$ftpUsername = 'tutsplanet';
$ftpPassword = 'xxxxxxx';
// open an FTP connection
$connId = ftp_connect($ftpHost) or die("Couldn't connect to $ftpHost");
// login to FTP
@rintoug
rintoug / git_workflow.md
Last active December 17, 2020 13:28
Git Work Flow

How do I clone a specific Git branch?

git clone --single-branch --branch <branchname> <remote-repo>

Create a FEATURE Branch

git checkout -b feature/MYFEATURE develop

Pull other's changes from remote

git pull origin feature/featurename

<?php namespace App\Controllers;
class Upload extends BaseController
{
public function index()
{
return view('upload_form');
}
public function doupload()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Welcome to CodeIgniter 4!</title>
<meta name="description" content="The small framework with powerful features">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/png" href="/favicon.ico"/>
<!-- STYLES -->
@rintoug
rintoug / Upload_Controller.php
Created September 3, 2019 08:05
Upload form for upload image
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Upload_Controller extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->helper('url', 'form');
}
@rintoug
rintoug / createCustomerAttribute.php
Created May 2, 2019 08:03
Create customer attribute in Magento 1
<?php
(PHP_SAPI !== 'cli' || isset($_SERVER['HTTP_USER_AGENT'])) && die('cli only');
$baseDir = dirname(dirname(__FILE__));
print $baseDir;
require_once($baseDir.'/app/Mage.php');
umask(0);
@rintoug
rintoug / importimages.php
Last active April 15, 2019 04:27
Magento1 - Remove existing Media Gallery and Add New One at same loop
<?php
$product = Mage::getModel ( 'catalog/product' );
$product_id = $product->getIdBySku ( $sku);
$product->load ( $product_id );
/**
* BEGIN REMOVE EXISTING MEDIA GALLERY
*/
$attributes = $product->getTypeInstance ()->getSetAttributes ();
if (isset ( $attributes ['media_gallery'] )) {