Skip to content

Instantly share code, notes, and snippets.

View sergey-fritzler's full-sized avatar

Sergey Fritzler sergey-fritzler

  • Düsseldorf
  • 03:38 (UTC +02:00)
View GitHub Profile
@czenzel
czenzel / disable-automatic-image-crop.php
Created August 1, 2016 07:29
Wordpress - Disable Automatic Image Cropping
<?php
/*
Plugin Name: Disable Automatic Image Crop
Author: Wordpress Community
Description: wpse124009 - http://wordpress.stackexchange.com/questions/124009/why-wordpress-automatic-cropping-all-my-images and https://developer.wordpress.org/reference/functions/remove_image_size/
*/
add_action( 'init', 'czc_disable_extra_image_sizes' );
add_filter( 'image_resize_dimensions', 'czc_disable_crop', 10, 6 );
@overstrides
overstrides / Отключение преобразования телефонных номеров в ссылки Как отключить преобразование телефонных номеров в ссылки в мобильных браузерах
Для Safari (iPhone / IPod / IPad) и Android браузера
<meta name="format-detection" content="telephone=no">
<div class="map-iframe-container">
<h3>First Map</h3>
<iframe class="map-iframe"
frameborder="0" style="border:0; width: 100%; height: 100%"
src="https://www.google.com/maps/embed/v1/place?key=%GOOGLE_API_KEY%&q=%LOCATION%" allowfullscreen>
</iframe>
</div>
<div class="map-iframe-container">
<h3>Second Map</h3>
@sergejmueller
sergejmueller / .htaccess
Created June 14, 2016 19:18
WordPress Security: Prevent browser and search engines to request LOG (WP debug) and TXT (plugins readme) files in Apache
# To be placed in
# /wp-content/.htaccess
<FilesMatch "\.(log|txt)$">
Order Allow,Deny
Deny from all
</FilesMatch>
@nacholibre
nacholibre / backup.sh
Last active June 27, 2016 09:05
Shell script for server backup (sites and mysql databases) with i/o throttling.
#!/bin/bash
CURRENT_DATE=$(date +'%Y-%m-%d')
MYSQL_USER="mysql_user"
MYSQL=/usr/bin/mysql
MYSQL_PASSWORD="mysql_user_pass"
MYSQLDUMP=/usr/bin/mysqldump
BACKUP_DIR=/DATA/backup/$CURRENT_DATE
SITES_DIR=/www
@holin
holin / backup-site-database.sh
Created December 23, 2015 02:48
backup site
#!/bin/sh
RANDNUMBER=`shuf -i1-10000 -n1`
# echo "RANDNUMBER $RANDNUMBER"
cd /mnt/bak
# backup files
echo "backup files..."
cp -r /www/web/brch/public_html /root/bak/public_html_`date +"%Y-%m-%d"`_$RANDNUMBER
@IGGY-MODEL
IGGY-MODEL / WordPress
Created April 15, 2015 19:32
WordPress
//////// WordPress Get Custom Field
<?php echo get_post_meta($post->ID, 'year', true); ?>
/////// WordPress query_posts
<?php if ( have_posts() ) : query_posts('p=1');
while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php the_post_thumbnail(array(100, 100)); ?>
@sergejmueller
sergejmueller / .htaccess
Last active June 16, 2016 08:34
Stop search engines from indexing .txt, .log, .xml, .css and .js files in Apache
<FilesMatch "\.(txt|log|xml|css|js)$">
Header set X-Robots-Tag "noindex"
</FilesMatch>
@matthewpizza
matthewpizza / expandmactarfileinubuntu.sh
Created December 3, 2013 15:14
Problem: When I make a gzipped tar file in OS X and expand it in Ubuntu there are duplicates of every file with `._` prepended to the file name. Solution: Skip those stupid `._` files
tar -xzpvf mytarfile.tgz --exclude="._*"
@kparrish
kparrish / remote_backup.sh
Created October 22, 2013 18:26
Remote Backup
#!/bin/bash
# rsync backup, see www.linux.com/learn/tutorials/284789-writing-a-simple-bash-script-
SOURCEDIR1=/home/user
DESTDIR1=user@hostname:/path/to/folder
rsync -az --progress --exclude='*.bak' --rsh 'ssh ' $SOURCEDIR1 $DESTDIR1