Skip to content

Instantly share code, notes, and snippets.

@prajwal-stha
prajwal-stha / media-query.css
Created February 5, 2018 11:05 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
/*ECI:START: POST ATC Click: Recipe C */
var mobileCheck = function () {
var userAgent = false;
var mobileWidth = false;
if (navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
@prajwal-stha
prajwal-stha / content-deploy.sh
Created January 4, 2018 01:52
Magento 2 : deploy static content ( solve memory limit error of php )
php -dmemory_limit=6G bin/magento setup:static-content:deploy
@prajwal-stha
prajwal-stha / fix.vue
Last active August 5, 2021 23:11
ERROR in ./~/prismjs/themes/prism.css Module parse failed: /Applications/MAMP/htdocs/wpd-beaver-popups/node_modules/prismjs/themes/prism.css Unexpected token (7:10) You may need an appropriate loader to handle this file type. | */ | | code[class*="language-"], | pre[class*="language-"] { | color: black; @ ./res/src/main.js 10:0-34 ERROR in js/bu…
// Add this line to package.json
// "uglifyjs-webpack-plugin": "^1.0.1"
//Add codes below on webpack.config.js
const Uglify = require('uglifyjs-webpack-plugin')
new Uglify({
sourceMap: false,
uglifyOptions: {
output: {
beautify: false
},
@prajwal-stha
prajwal-stha / hex2rgb.js
Created October 8, 2017 11:08 — forked from polotek/hex2rgb.js
Convert hex colors to rgba
/**
* hex2rgb - function for converting hex colors to rgb(a)
*
* Shout out to http://hex2rgba.devoth.com/
*
* @hex (String) - The hex value. Can be prefixed with "#" or not. Can be
* long format (6 chars) or short format (3 chars)
* @opacity (number between 0 and 1) - This is an optional float value that
* will be used for the opacity
*
@prajwal-stha
prajwal-stha / function.php
Created August 1, 2017 15:54
Format phone number in US format
function format_phone_us($phone) {
// note: making sure we have something
if(!isset($phone{3})) { return ''; }
// note: strip out everything but numbers
$phone = preg_replace("/[^0-9]/", "", $phone);
$length = strlen($phone);
switch($length) {
case 7:
return preg_replace("/([0-9]{3})([0-9]{4})/", "$1-$2", $phone);
break;
@prajwal-stha
prajwal-stha / functions.php
Last active August 1, 2017 15:59
Functions code
<?php
/**
* Crumina Theme Functions
*
*/
@prajwal-stha
prajwal-stha / global_code.js
Created July 24, 2017 09:56
Global Code placed from ABTasty.
/*ECI 10 Standard R-pts (additional 4 cart-closer r-pts) : sportsfanfare.com*/
console.log('Hello');
$(document).ready(function() {
var ecitests = [];
for(i = 0; i < ABTasty.tests.length; i++) {
ecitests.push(ecitests[i]);
ecitests[i] = ABTasty.tests[i].datas.id;
var ECIdebug = false;
var ABeventTrack = function(elem, val, testID) {
var eci_jjp = {
eci_swap_sections: function( ){
$('#bodycontent .container').first().insertAfter($('#bodycontent .container').last());
return $(this);
},
eci_init: function(){
var obj = this;
obj.eci_swap_sections();
}
@prajwal-stha
prajwal-stha / sample_reveal_module.js
Last active December 27, 2018 09:24
Sample Codes for The Module Pattern.
jQuery(document).ready(function($) {
'use strict';
var mblPPSeparateQty = {
addBtn: function() {
var topclass = '<div class="eci-add-to-cart-203204"><h5>Quantity:</h5>';
var inputgroup = '<div class="input-group"><span class="input-group-btn"><button type="button" class="btn btn-default btn-number" disabled="disabled" data-type="minus" data-field="quant[1]"><span class="eci-icon eci-icon-minus"></span></button></span><input type="text" name="quant[1]" class="form-control input-number" value="1" min="1" max="100000000"><span class="input-group-btn"><button type="button" class="btn btn-default btn-number" data-type="plus"data-field="quant[1]"><span class="eci-icon eci-icon-plus"></span></button></span></div>';
var btn = '<input class="eci-add-to-cart-btn" value="Add to Cart" id="ysw-add-to-cart" type="submit">';