Skip to content

Instantly share code, notes, and snippets.

View ankitsam's full-sized avatar
🥂
Cheers

Ankit Sharma ankitsam

🥂
Cheers
View GitHub Profile
@ankitsam
ankitsam / sms.php
Created May 1, 2017 08:25
Send SMS using AWS SNS via AWS PHP SDK
use Aws\Sns\SnsClient;
$sns = \Aws\Sns\SnsClient::factory(array(
'credentials' => [
'key' => '<access_key>',
'secret' => '<access_secret>',
],
'region' => '<region>',
'version' => 'latest',
));
@ankitsam
ankitsam / ec2_mysql_public_html_backup.sh
Last active July 29, 2021 22:52
Shell Script for daily backup EC2(Ubuntu) - Separate websites & MySql databases zips to S3
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# Variables
USER="root"
PASSWORD=""
OUTPUT="/home/ubuntu/backups"
WWW="/var/www/*"
BUCKET="Backup-Bucket"
@ankitsam
ankitsam / magento_category_list_by_product_id.php
Last active September 21, 2017 16:52
Magento Category Products List Sort by Product ID
<?php
/* Copy file
* app\code\core\Mage\Catalog\Block\Product\List.php
* to
* app\code\local\Mage\Catalog\Block\Product\List.php
*/
/* Replace */
$this->_productCollection = $layer->getProductCollection()->addAttributeToSort($_GET['order'], $_GET['dir']);
@ankitsam
ankitsam / dataTables.bootstrap.js
Created February 13, 2014 05:34
AMD version of dataTables plugin for Bootstrap dataTables.bootstrap.js (https://github.com/DataTables/Plugins/tree/master/integration/bootstrap/3)
(function (root, factory) {
// Set up DT_bootstrap appropriately for the environment.
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery', 'dataTables'], function ($) {
factory($);
});
} else {
// Browser globals
factory(root.jQuery);