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
@markshust
markshust / kadira-apm-setup-README.md
Last active June 11, 2020 02:04
Kadira APM Setup

Kadira APM Setup

Short guide on how to get Kadira APM setup with Docker.

  1. Setup at least on instance with 1.7GB RAM.
  2. Open up firewall ports for inbound TCP port 443. Also open up 11011 & 4000 for debugging. Port 11011 is kadira-engine, port 4000 is the kadira-ui.
  3. Setup a Mongo database, and have the connection string ready (with username and password).
  4. Install Docker https://docs.docker.com/engine/installation/linux/docker-ce/debian/ , run sudo usermod -aG docker your-user, then install Docker Compose https://docs.docker.com/compose/install/ on the instance.
  5. Verify that you have docker and docker compose installed correctly and can use it.
  6. Setup A-records to point your kadira-ip to kadira-engine.domain.com and kadira-ui.domain.com.
@markshust
markshust / ContainerMyComponent.js
Created October 13, 2016 20:04
check if react component is mounted using recompose
import { compose, lifecycle, mapProps, withState } from 'recompose';
import MyComponent from '../components/MyComponent';
let isMounted = false;
const enhance = compose(
lifecycle({
componentDidMount() {
isMounted = true;
},
@d1i1m1o1n
d1i1m1o1n / text
Created October 6, 2016 12:16
How to disable auto-save in phpstorm
How to disable auto-save:
Go to File > Settings (Ctrl+Alt+S).
Go to Appearance & Behavior > System Settings.
Make sure the two are unchecked:
Save files on frame deactivation
Save files automatically if application is idle for x sec.
Go to Editor > General > Editor Tabs
Put a checkmark on "Mark modified files with asterisk"
(Optional but recommended) Under "Tab Closing Policy", select "Close non-modified files first". You may also want to increase the number of allowed tabs.
Click Apply > OK.
@maxcnunes
maxcnunes / alias-docker-compose.sh
Last active August 27, 2023 15:11
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'
@piotrekkaminski
piotrekkaminski / gist:9bc45ec84028611d621e
Last active August 8, 2023 08:38
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!

TL;DR

Meteor is great at sharing code between different builds for different platforms. You can use the same source for your browser builds, server builds, your builds for iOS, Android, ... But how to organize your project to be able to orchestrate your builds for different apps and services from the same source? This post elaborates on the reasons why you need these different builds and how you could accomplish this with Meteor easily.

Use cases: Why would you build different apps?

1. Different apps for different roles

Say you have an app with completely different end user experiences depending on their role. It is common practice to have the user logged in, check her authorization (role) and then setup different routes or load different templates to serve that type of user’s needs. While doing so, all types of users load the same build and the app decides what portions of the build to use and what not to use.

<?php
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@rogerclotet
rogerclotet / gist:3901b03107437b247b03
Last active February 9, 2023 13:03
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 "$@"
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
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