Skip to content

Instantly share code, notes, and snippets.

View marcwieland95's full-sized avatar

Marc Wieland marcwieland95

View GitHub Profile
@marcwieland95
marcwieland95 / README.md
Created March 18, 2017 15:56 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
p {
word-wrap: break-word; /* old name */
overflow-wrap: break-word;
}
add_action('generate_rewrite_rules', 'themes_dir_add_rewrites');
function themes_dir_add_rewrites() {
$theme_name = next(explode('/themes/', get_stylesheet_directory()));
global $wp_rewrite;
$new_non_wp_rules = array(
'styles/(.*)' => 'wp-content/themes/'. $theme_name . '/styles/$1',
'scripts/(.*)' => 'wp-content/themes/'. $theme_name . '/scripts/$1',
'images/(.*)' => 'wp-content/themes/'. $theme_name . '/image/$1',
@marcwieland95
marcwieland95 / admin.php
Created August 23, 2018 17:48
Remove Gutenberg on pages
class Admin {
function __construct() {
// Gutenberg
add_action( 'current_screen', array( $this, 'clean_page_gutenberg' ) );
}
@marcwieland95
marcwieland95 / User.php
Last active September 26, 2018 15:16
WP User Object Abstraction
<?php
namespace PROJECT\User;
/**
* @author Marc Wieland <mail@marcwieland.name>
*/
class User
{
/**
}
}
}
.content_block__module__abo {
> p {
margin: 0 15px 20px;
}
@marcwieland95
marcwieland95 / Afterglow.icls
Created October 22, 2018 18:58
PhpStorm Themes
<scheme name="Afterglow" version="142" parent_scheme="Default">
<option name="LINE_SPACING" value="1.25" />
<font>
<option name="EDITOR_FONT_NAME" value="Menlo" />
<option name="EDITOR_FONT_SIZE" value="15" />
</font>
<font>
<option name="EDITOR_FONT_NAME" value="Inconsolata" />
<option name="EDITOR_FONT_SIZE" value="14" />
</font>
@marcwieland95
marcwieland95 / imagemagick.sh
Last active October 30, 2018 13:19
Progressiv images - check with imagemagick
brew install imagemagick
identify -verbose URL.webp | grep Interlace
<?php
/**
* Truncates the specified text to the specified length to the last whole word and
* adds ellipses to the end of the truncated string.
*
* @param string $text The text to truncate.
* @param int $length The maximum allowed length of the text.
* @return string The text if it's less than the length of the specified length or the text truncated to the specified length.
*/
public function truncate($text, $length)
@marcwieland95
marcwieland95 / footer.php
Created January 3, 2019 19:54
Automatically updating copyright year - http://updateyourfooter.com/