Skip to content

Instantly share code, notes, and snippets.

@manojiksula
manojiksula / LoginController.php
Created July 16, 2017 15:22 — forked from SaeedPrez/LoginController.php
Laravel 5.4 Additional Login Conditions - Add custom error message.
<?php
// This is code to return custom error message
// for Youtube tutorial: Laravel 5.4 Additional Login Conditions
// https://www.youtube.com/watch?v=Z8s6uhhD1Pk
namespace App\Http\Controllers\Auth;
@manojiksula
manojiksula / Magento-order-sum-breakout-report.sql
Created March 13, 2018 09:32 — forked from tegansnyder/Magento-order-sum-breakout-report.sql
Magento - Sum of All Orders by Month and Year Breakdown includes Discount Sums
SELECT sub_query.month_ordered,
sub_query.year_ordered,
SUM(sub_query.base_subtotal) AS sum_base_subtotal,
SUM(sub_query.discount_amount) AS sum_discount_amt,
SUM(sub_query.order_qty) AS sum_total_item_count,
COUNT(sub_query.entity_id) AS total_orders
FROM
(SELECT so.entity_id,
MONTH(so.created_at) AS month_ordered,
YEAR(so.created_at) AS year_ordered,

STEPS

  • Click on Help menu

  • Select Enter License

  • Then paste given KEY given at bottom

  • Finally click on Use License

login url
<?php echo Mage::getUrl('customer/account/login'); ?>
logout url
<?php echo Mage::getUrl('customer/account/logout'); ?>
My Account url
<?php echo Mage::getUrl('customer/account'); ?>
Register url
@manojiksula
manojiksula / magento_javascript_formvalidation.js
Created December 9, 2018 07:49 — forked from obiyoda/magento_javascript_formvalidation.js
Call the magento javascript form validation
//form-validate is the id of the form
var dataForm = new VarienForm('form-validate', true);
if(dataForm.validator.validate()){
//do stuff here when the form is validated
}
@manojiksula
manojiksula / gitcom.md
Created December 15, 2018 16:48 — forked from jednano/gitcom.md
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

$ git init
@manojiksula
manojiksula / Jenkinsfile
Created December 16, 2018 16:48 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage concurrency constraints, ...
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
/*
Please make sure to add the following environment variables:
HEROKU_PREVIEW=<your heroku preview app>
HEROKU_PREPRODUCTION=<your heroku pre-production app>
HEROKU_PRODUCTION=<your heroku production app>
public static function ansiEncode($array = array(), $fields = array()) {
if(!empty($array)) {
for($i = 0; $i < count($array); $i++) {
foreach($fields as $key => $value) {
try {
# v. 20180110
TARGET=/var/www/B2C_America_PA/html
TMPTARGET=$TARGET/../html-in-progress
BACKUP=$TARGET/../html-backup
USER=apache
GROUP=apache
echo "Temporary folder: $TMPTARGET"
echo "Workspace folder: $WORKSPACE"
def getProjectName() {
return 'JenkinsPipeline'
}
def getJDKVersion() {
return 'jdk1.8.0_101'
}
def getMavenConfig() {
return 'maven-config'