Skip to content

Instantly share code, notes, and snippets.

View markshust's full-sized avatar
🤓
Working on educational & training material for Magento 2

Mark Shust markshust

🤓
Working on educational & training material for Magento 2
View GitHub Profile
<template>
<div>
<input
type="text"
placeholder="Search Your Interest"
@input="debounceSearch()"
v-model="searchInput"
/>
</div>
</template>
@markshust
markshust / gpt4_text_compression.md
Created August 2, 2023 17:12 — forked from jimsrc/gpt4_text_compression.md
Minimizing the number of tokens usage to interact with GPT-4.

Overview

I just read this trick for text compression, in order to save tokens in subbsequent interactions during a long conversation, or in a subsequent long text to summarize.

SHORT VERSION:

It's useful to give a mapping between common words (or phrases) in a given long text that one intends to pass later. Then pass that long text to gpt-4 but encoded with such mapping. The idea is that the encoded version contains less tokens than the original text. There are several algorithms to identify frequent words or phrases inside a given text, such as NER, TF-IDF, part-of-speech (POS) tagging, etc.

@markshust
markshust / adobe-cloud-magerun-dev-console.sh
Created April 26, 2022 14:33 — forked from vbuck/adobe-cloud-magerun-dev-console.sh
Use N98-Magerun Dev Console in Adobe Cloud Environments
cd /tmp
curl -O https://files.magerun.net/n98-magerun2.phar
chmod +x ./n98-magerun2.phar
XDG_CONFIG_HOME="/tmp" ./n98-magerun2.phar dev:console --root-dir=$MAGENTO_CLOUD_DIR
@markshust
markshust / gist:8de123470cc98151bb3402c7c04bee8f
Created October 14, 2019 20:34 — forked from piotrekkaminski/gist:9bc45ec84028611d621e
How to automatically download patches and release of Magento
1) First you need to generate download token. Login to your account on magento.com and generate it in Account Settings->Downloads Access Token
2) You will need your MAGEID as well. It is shown at the top-left in your account page.
3) curl -k https://MAGEID:TOKEN@www.magentocommerce.com/products/downloads/info/help
4) Profit!
@markshust
markshust / disable-xdebug.sh
Last active December 19, 2017 23:16 — forked from hacfi/disable-xdebug.sh
OS X homebrew php 7.0 enable/disable xdebug extension script
#!/bin/sh
sed -i.default "s/^zend_extension=/;zend_extension=/" /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php71.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php71.plist
echo "xdebug disabled"
@markshust
markshust / disable-xdebug.sh
Created December 19, 2017 23:13 — forked from hacfi/disable-xdebug.sh
OS X homebrew php 7.0 enable/disable xdebug extension script
#!/bin/sh
sed -i.default "s/^zend_extension=/;zend_extension=/" /usr/local/etc/php/7.0/conf.d/ext-xdebug.ini
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php70.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php70.plist
echo "xdebug disabled"
@markshust
markshust / gist:c16c56525f55b71527f36faa4bd166ab
Created August 29, 2017 19:04 — forked from rogerclotet/gist:3901b03107437b247b03
Execute PHPUnit disabling xdebug
# Before using these aliases and function you must make a backup of your xdebug.ini
# (in this case /etc/php/conf.d/xdebug.ini.back)
# You will also need to be able to edit xdebug.ini
alias xdebug-disable='echo "" > /etc/php/conf.d/xdebug.ini'
alias xdebug-restore='cat /etc/php/conf.d/xdebug.ini.back > /etc/php/conf.d/xdebug.ini'
phpu() {
xdebug-disable
phpunit "$@"
@markshust
markshust / gist:b10c90fd7ba39907a84b0ddea40b3c6a
Created August 29, 2017 19:04 — forked from rogerclotet/gist:3901b03107437b247b03
Execute PHPUnit disabling xdebug
# Before using these aliases and function you must make a backup of your xdebug.ini
# (in this case /etc/php/conf.d/xdebug.ini.back)
# You will also need to be able to edit xdebug.ini
alias xdebug-disable='echo "" > /etc/php/conf.d/xdebug.ini'
alias xdebug-restore='cat /etc/php/conf.d/xdebug.ini.back > /etc/php/conf.d/xdebug.ini'
phpu() {
xdebug-disable
phpunit "$@"
@markshust
markshust / alias-docker-compose.sh
Created April 19, 2017 19:57 — forked from maxcnunes/alias-docker-compose.sh
Aliases for docker-compose
alias c='docker-compose'
alias cb='docker-compose build'
alias cup='docker-compose up'
alias cr='docker-compose run --service-ports --rm'
alias crl='docker-compose run --service-ports --rm local'
alias crd='docker-compose run --service-ports --rm develop'
alias crt='docker-compose run --rm test'
alias crp='docker-compose run --rm provision'
alias crci='docker-compose run --rm ci'
alias crwt='docker-compose run --rm watchtest'
@markshust
markshust / install-comodo-ssl-cert-for-nginx.rst
Created February 5, 2016 06:31 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert