This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (https?://[^\/]*?/)([^"]*?\.(jpg|png|js|webp|svg|css|pdf)) | |
| /media/courts-aws/assets/$2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /vendor/magento/framework/View/Asset/File.php | |
| public function getUrl() | |
| { | |
| return '/static/' . $this->getPath(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # cd /etc/nginx/ | |
| # sudo mkdir ssl | |
| # sudo openssl req -x509 -sha256 -newkey rsa:2048 -keyout cert.key -out cert.pem -days 1024 -nodes -subj '/CN=www.domain.local' | |
| upstream fastcgi_backend { | |
| # use tcp connection | |
| # server 127.0.0.1:9000; | |
| # or socket | |
| server unix:/run/php/php7.0-fpm.sock; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var data = $(form).serializeArray().reduce(function(obj, item) { | |
| obj[item.name] = item.value; | |
| return obj; | |
| }, {}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Linkify(inputText) { | |
| //URLs starting with http://, https://, or ftp:// | |
| var replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim; | |
| var replacedText = inputText.replace(replacePattern1, '<a href="$1" target="_blank">$1</a>'); | |
| //URLs starting with www. (without // before it, or it'd re-link the ones done above) | |
| var replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim; | |
| var replacedText = replacedText.replace(replacePattern2, '$1<a href="http://$2" target="_blank">$2</a>'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define('utils/getParamValue', ['jquery'], function ($) { | |
| 'use strict'; | |
| var getParam = {}; | |
| getParam.byName = function (name, url) { | |
| if (typeof url === 'undefined' || url === '' || url === null) url = window.location.href; | |
| name = name.replace(/[\[\]]/g, "\\$&"); | |
| var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"); | |
| var results = regex.exec(url); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function currencyFormat(num, decimals, dec_point, thousands_sep) { | |
| var n = num, prec = decimals; | |
| var toFixedFix = function (n,prec) { | |
| var k = Math.pow(10,prec); | |
| return (Math.round(n*k)/k).toString(); | |
| }; | |
| n = !isFinite(+n) ? 0 : +n; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| ############################################################################### | |
| # Common Alias ################################################################ | |
| ############################################################################### | |
| WWW_GROUP=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` | |
| alias ...="cd ../../" | |
| alias ll="ls -al --group-directories-first" | |
| alias glom="git pull origin master" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| var GlobalVar = GlobalVar || {}; | |
| (function($, undefined) { | |
| var FunctionName = GlobalVar.FunctionName = function(opts) { | |
| FunctionName.prototype._singletonInstance = this; | |
| opts = opts || {}; | |
| var defaultOpts = { | |
| 'element' : '.elementClassOrdId' | |
| }; |