Skip to content

Instantly share code, notes, and snippets.

View tschifftner's full-sized avatar

Tobias Schifftner tschifftner

View GitHub Profile
@magicdude4eva
magicdude4eva / zsh-syntax-highlighting paste performance improvement
Last active April 19, 2024 14:03
zsh-syntax-highlighting paste performance improvement
Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
@sonnygauran
sonnygauran / database-tables-size.sql
Created February 5, 2017 12:27
Show current database's table sizes in descending order. Usually ran inside Sequel Pro Based on http://stackoverflow.com/questions/9620198/how-to-get-the-sizes-of-the-tables-of-a-mysql-database.
SET @table=(SELECT DATABASE());
select @table;
SELECT
table_schema as `Database`,
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM information_schema.TABLES
WHERE table_schema = @table
ORDER BY (data_length + index_length) DESC;
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

anonymous
anonymous / magento_deletedbprefix.php
Created July 16, 2015 10:51
Remove Magento table prefix script with dry-run/test
<?php
$database_host = "localhost";
$database_user = "username";
$database_password = "password";
$magento_database = "databasename";
$table_prefix = "prefixhere_";
$dryrun = true; // change to false when you want to commit changes
$db = mysql_connect($database_host, $database_user, $database_password);