Skip to content

Instantly share code, notes, and snippets.

View tazeverywhere's full-sized avatar

Sylvain tazeverywhere

View GitHub Profile
@tazeverywhere
tazeverywhere / Crawl-wget.sh
Last active August 29, 2015 14:21
Crawl wget
// voir ici http://www.createdbypete.com/articles/simple-way-to-find-broken-links-with-wget/
wget --spider -o ~/wget-xxx.log -e robots=on -w 1 -r http://www.xxx
// sans les images
wget --spider -o ~/wget-xxx.log -e robots=on -w 1 -r --reject=jpg,gif,png,jpeg http://www.xxx
@tazeverywhere
tazeverywhere / wp_changeLoginUrl.php
Last active September 27, 2016 14:12
WP - change login/admin URL
<?php
//////////////////////
// SECURE WP_ADMIN //
//////////////////////
// ---- 1. edit wp-config.php
/* tells wordpress what the new directory is, and updates the cookie path.
define( 'WP_ADMIN_DIR', 'manager' );
define( 'ADMIN_COOKIE_PATH', '/' );
*/
@tazeverywhere
tazeverywhere / acf-gallery-wpml.php
Last active August 29, 2015 14:27
ACF Gallery field with WPML
<!-- WEKMENU -->
<?php
// Global vars
$pageResto = 40;
$weekMenu = get_field('weekmenu', $pageResto);
?>
<?php if ($weekMenu) { ?>
<div class="sidebar-block week-menu">
<span class="icon-title glyphicon glyphicon-cutlery" aria-hidden="true"></span>
<div class="menu-content">
<?php
/*
* Fix Advanced Custom Field dynamic key filter for repeater entries
* @link http://www.advancedcustomfields.com/resources/how-to/how-to-query-posts-filtered-by-custom-field-values/
*/
add_filter( 'posts_where', 'acf_repeater_dynamic_where', 10, 2 );
function acf_repeater_dynamic_where( $where, &$wp_query ){
if( !empty( $wp_query->meta_query->queries ) ){
$keys = wp_list_pluck( $wp_query->meta_query->queries, "key" );
@tazeverywhere
tazeverywhere / scss-specificity.scss
Created April 1, 2016 16:40
Css specificity with sass
&__link {
// Hacks for dealing with specificity
// http://csswizardry.com/2014/07/hacks-for-dealing-with-specificity/
&#{&} {
color: black;
}
}

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.

On master:

> git co -b temp
@tazeverywhere
tazeverywhere / gist:2d56c625e4b2d42fef7e9a71bad5cac6
Created May 16, 2017 08:58 — forked from depoulo/gist:5832073
CSS-only multi-line ellipsis with generated content. License: http://www.wtfpl.net/txt/copying/
@import "compass/css3/images";
// CSS-only multi-line ellipsis with generated content
// yields `position:relative`, so remember to declare an eventual `position:absolute/fixed` *after* including this mixin
@mixin limitLines(
$maxLinesPortrait, // Mandatory: The number of lines after which the clipping should take action.
$maxLinesLandscape: $maxLinesPortrait, // You may provide a different line limit for landscape orientation.
// Note that 'portrait' is our default orientation. However, if you omit $maxLinesLandscape,
// the value of $maxLinesPortrait is used for whatever orientation (that is, without a media query).
# deploy.rb from https://github.com/roots/bedrock-capistrano modified by Björn Folbert, https://gist.github.com/folbert/
# Folbert-comment: from Capistrano doc:
# Here we'd set the name of the application, must be in a format that's safe for
# filenames on your target operating system.
set :application, 'APPLICATIONNAME'
# Folbert-comment: use the SSH url for the repo from GitHub
set :repo_url, 'git@github.com:USER/REPO.git'
@tazeverywhere
tazeverywhere / Gemfile
Created September 19, 2017 14:13 — forked from hal0gen/Gemfile
Wordmove + Bedrock + Capistrano: using Wordmove for DB and assets, Capistrano for all the rest
source 'https://rubygems.org'
gem 'capistrano', '~> 3.4.0'
gem 'capistrano-composer'
gem 'wordmove'