Skip to content

Instantly share code, notes, and snippets.

View mikebranderhorst's full-sized avatar

Mike Branderhorst mikebranderhorst

  • Deo Volente Research
  • The Netherlands
View GitHub Profile
@vitorbritto
vitorbritto / rm_mysql.md
Last active July 28, 2025 19:10
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@macik
macik / cot_string_truncate.php
Last active August 29, 2018 08:58
Function to truncate string allowes treat it as HTML code.
<?php
/**
* Truncates text.
*
* Cuts a string to the length of $length
*
* @param string $text String to truncate.
* @param integer $length Length of returned string, including ellipsis.
* @param boolean $considerhtml If true, HTML tags would be handled correctly *
@ottonet
ottonet / makemod
Last active April 12, 2023 14:57
osx compatible magento modman generator
for i in `find . -type f | grep -v \.git | grep -v \.DS_Store | grep -v "^.$" | grep -v "modman" | grep -v "composer.json" | grep -v \.txt | grep -v \.pdf | sed 's/\.\///'`; do echo ${i} ${i}; done > modman
@piotrekkaminski
piotrekkaminski / PATCH_SUPEE-389_EE_1.12.0.2_v2.sh
Created September 5, 2014 20:18
SUPEE-389: Every time the catalog URL is rendexed, a new custom rewrite is created
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
@mrwweb
mrwweb / truncate_html_string.php
Created July 3, 2014 18:08
Improved version of text-truncating html string function to improve character count accuracy. Code found on oikos.org.uk/2013/02/tech-notes-a-wordpress-excerpt-with-html-tags/.
<?
/**
* Truncates text.
*
* Cuts a string to the length of $length and replaces the last characters
* with the ending if the text is longer than length.
*
* See: oikos.org.uk/2013/02/tech-notes-a-wordpress-excerpt-with-html-tags/
* See also: wpengineer.com/2410/dont-use-strlen/
* See also also: oikos.org.uk/2013/02/tech-notes-a-wordpress-excerpt-with-html-tags/#comment-1467093876
@kubaceg
kubaceg / databaseBackup.sh
Last active May 1, 2017 11:32
n98Magerun magento database backup script, creates daily, weekly and monthly dumps
#!/bin/bash
#CONFIG
backupDir='/mnt/backup'
magentoDir='/var/www/magento/htdocs'
magerunPath='/usr/bin/n98-magerun.phar'
#NUMBER OF DAYS TO KEEP BACKUPS
dailyKeepDays=7
weeklyKeepDays=30
@dergachev
dergachev / Docker-forward-ssh-agent.sh
Created May 15, 2014 17:51
Allows SSH Agent forwarding into docker container
# NB: the line with SSH_AUT_SOCK allows SSH Agent forwarding into docker container
# NB: umask 002 makes all newly created files group-writable
docker-run-with-agent:
docker run -t -i \
-v `pwd`/source:/srv/docker-jekyll/source/ \
-v `pwd`/deploy:/srv/docker-jekyll/deploy \
-v `dirname $(SSH_AUTH_SOCK)`:`dirname $(SSH_AUTH_SOCK)` -e SSH_AUTH_SOCK=$(SSH_AUTH_SOCK) \
-p 4000:4000 \
dergachev/docker-jekyll \
/bin/bash -c "umask 002; $(cmd) $(args)"
@MikeWilkie
MikeWilkie / local.xml
Last active November 28, 2018 04:47
Magento – Disable Excessive Logging and Reporting in app/etc/local.xml
<?xml version="1.0"?>
<!-- license -->
<config>
<global>
<!-- global config -->
</global>
<frontend>
<events>
<!-- disble logs -->
<controller_action_predispatch>
@peterjaap
peterjaap / magento-testing-scenarios.md
Last active May 13, 2025 08:03
Magento testing scenarios

Magento testing scenarios

For use after an upgrade to verify the correct working of Magento

SHIP IT

Frontend

General

  • Activate all logs on the server (PHP, MySQL, Magento, mail, etc)
  • Check meta tags in HTML
@lymanlai
lymanlai / mysqldump-cron.sh
Last active February 10, 2020 13:17
this script will mysqldump your db daily, weekly and monthly. and it will only keep three of them, while doing the fourth backup, it will delete the first one first.
#!/bin/bash
#author Lyman Lai
#date 2013-12-30
#source http://002.yaha.me/item/22728a58-c967-46d5-93eb-2649d684a9aa/
MYSQL_USER="yourname"
MYSQL_HOST="localhost"
MYSQL_PASSWORD="yourpassword"
MYSQL_BIN="$(which mysql)"