Skip to content

Instantly share code, notes, and snippets.

@jesders
jesders / mixins.scss
Created June 13, 2017 14:34
CSS Triangle Mixin
@mixin borderTrianlge($direction, $size, $color)
{
$trans: $size solid transparent;
$color: $size solid $color;
width: 0;
height: 0;
@if $direction==up or $direction==down
{
border-left: $trans;
border-right: $trans;
@jesders
jesders / .htaccess
Last active January 29, 2019 13:47
.htaccess Enable Compression
# Enable Compression
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
# END GZIP
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
@jesders
jesders / .htaccess
Last active October 5, 2018 20:34
Force HTTPS
#Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://domain.com%{REQUEST_URI} [R=301,L]
#NEW
##########
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://gilpinezo.com/$1 [R=301,L]
@jesders
jesders / doctype.php
Created March 30, 2018 15:38
Create Canonical URL
<link rel="canonical" href="https://domain.com/">
@jesders
jesders / gist:cb73cd1d71ec491258520e6322711332
Last active October 12, 2018 19:12
Create Tar file from files
#Gets files from past day and zips them in tar file.
find . -mtime -1 | xargs tar --no-recursion -czf myfile.tgz
#Update
find . -type f -mtime -30 -print | xargs tar -czf changed.tar.gz
@jesders
jesders / gist:a4d61dfcc44ee2b998f4627a7a454cc7
Last active May 10, 2018 20:42
Wordpress - Get all Subcategories of Certain ID and get Images Attached
<?php
$args = array(
'child_of' => 6,
'post_type' => 'attachment'
);
$categories = get_categories( $args );
foreach($categories as $category) {
echo '<h2>'.$category->name.'</h2>';
@jesders
jesders / gist:0e8bd55040d7bd14009c6d13d37d1343
Created August 16, 2018 15:03
Add ID's to media imports remotely added to uploads folder
php wp-cli.phar media import wp-content/uploads/**/**/*.* --preserve-filetime
@jesders
jesders / gist:e50c866ddb223f6b257ce80b7ea7ec18
Last active September 10, 2018 12:35
Rsync Full Wordpress Site without server files
rsync --dry-run -avz -e 'ssh -p {PORT}' username@domain.com:/home/username/public_html/ ./public_html/ --exclude 'wp-config.php' --exclude '.*' --exclude 'cgi-bin' --exclude 'error_log'
@jesders
jesders / .htaccess
Last active April 1, 2019 17:27
htaccess rule for forcing https
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L,NE]
# Redirect this entire domain, abc.com, to the domain xyz.com
RedirectMatch 301 ^(.*)$ http://www.xyz.com