Skip to content

Instantly share code, notes, and snippets.

View gunjanpatel's full-sized avatar

Gunjan Patel gunjanpatel

View GitHub Profile
@gunjanpatel
gunjanpatel / phing.md
Last active August 29, 2015 13:56
phing setup in sublime text 2

Setup Phing on Sublime Text 2

  • We will create a custom build system from Tools > Build System > New Build System:
{
    "cmd": ["phing", "-f" , "$file"],
    "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
    "selector": "source.php",
 "windows":
@gunjanpatel
gunjanpatel / getshoppergroup.php
Last active August 29, 2015 14:06
get redshop shopper group from joomla user id
<?php
require_once JPATH_SITE . '/components/com_redshop/helpers/user.php';
$rsUserhelper = new rsUserhelper;
$shopperGroupId = (int) $rsUserhelper->getShopperGroup(JFactory::getUser()->id);
$shopperGroup = $rsUserhelper->getShoppergroupData(JFactory::getUser()->id);
@gunjanpatel
gunjanpatel / gist:b083dff8a0f49f9a02d5
Created October 19, 2014 05:52
postgresql installation on ubuntu
http://www.ubuntugeek.com/howto-setup-database-server-with-postgresql-and-pgadmin3.html
@gunjanpatel
gunjanpatel / elasticbeanstalk.md
Last active August 29, 2015 14:12
amazon elastic beanstalk update environment

Amazon Elastic Beanstalk update file using git

  1. Create folder named as .elasticbeanstalk and create files named config and aws_credentials in the same folder.

    1. config
    [global]
    

ApplicationName=

@gunjanpatel
gunjanpatel / phpdoc.md
Created February 6, 2015 06:44
phpdoc generator or creator command

phpdoc -d "." -t "/var/www/html/redshopdoc/responsive-twig" --template="responsive-twig"

#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@gunjanpatel
gunjanpatel / filter.md
Last active September 25, 2015 04:55
joomla method to filter username string
<?php
$string = 'Hello $ World/';
$username = JFilterInput::getInstance()->clean($string, 'USERNAME');

redSHOP - Sagepay Integration Help

  • A unique Vendor name and encryption password are provided when Sage Pay create a test account for you. This data is emailed to the contacts registered on the account. Please email support@sagepay.com if you need reminding of your passwords.

  • Your test encryption password is unlikely to be the same as your live encryption password.

  • The encryption password is the 16-character string that will look something like: SFLs9HnK3SjHbM0O

  • To use simulator mode you can create your own simulator account at: https://support.sagepay.com/apply/RequestSimAccount.aspx Or, you can use our simulator account (details supplied with the component) if you only want to use Simulator mode to generate a IP address error - this will display your server address as seen by the SagePay server.

@gunjanpatel
gunjanpatel / js filter string
Last active December 16, 2015 21:48
Javascript input filter validation for vulnerabilities
frmUserfieldName.replace(/[^a-z0-9]/gi, '_').toLowerCase();
@gunjanpatel
gunjanpatel / git remote update.sh
Created May 2, 2013 13:07
Update local git repository with upstream server in few clicks
#!/bin/bash
clear
echo -n "Please Enter directory where you have clone your fork: "
read dir_path
echo "Directory entered: $dir_path "
if cd $dir_path; then
echo -n "Please Enter remote name: "