Skip to content

Instantly share code, notes, and snippets.

@videogramme
videogramme / wordpress-valet-install.md
Created August 1, 2018 12:36 — forked from orumad/wordpress-valet-install.md
How to install Wordpress from command line in Valet

How to install Wordpress from command line in Valet

I use Valet as my local web development environment (PHP, Laravel, Wordpress, ...)

This gist is my own recipe to install Wordpress from the command line to use it with Valet. Maybe this is useful for you too.

Install 'WP-CLI' command line tool

@videogramme
videogramme / restapi.txt
Created August 3, 2017 21:03 — forked from chrismccoy/restapi.txt
WordPress REST API Resources
Demo mobile app using WordPress REST API
https://github.com/scottopolis/wp-rest-api-demo
Expose Post Formats in WP REST API
https://github.com/kucrut/wp-bridge-post-formats
WP REST API endpoint for menus
https://github.com/kucrut/wp-bridge-menus
Powerful framework plugin for turning your WordPress theme into an isomorphic JavaScript application using the REST API
@videogramme
videogramme / wp-modifydb.php
Created March 22, 2017 14:51 — forked from jcanfield/wp-modifydb.php
Serialized PHP Search and Replace
<?php
/**
*
* Safe Search and Replace on Database with Serialized Data v2.0.1
*
* This script is to solve the problem of doing database search and replace when
* developers have only gone and used the non-relational concept of serializing
* PHP arrays into single database columns. It will search for all matching
* data on the database and change it, even if it's within a serialized PHP
* array.
@videogramme
videogramme / jquery.email-antispam.js
Created November 14, 2016 10:25 — forked from mathiasbynens/jquery.email-antispam.js
Simple spam protection for email addresses using jQuery
/* Simple spam protection for email addresses using jQuery.
* Well, the protection isn’t jQuery-based, but you get the idea.
* This snippet allows you to slightly ‘obfuscate’ email addresses to make it harder for spambots to harvest them, while still offering a readable address to your visitors.
* E.g.
* <a href="mailto:foo(at)example(dot)com">foo at example dot com</a>
* →
* <a href="mailto:[email protected]">[email protected]</a>
*/
$(function() {
@videogramme
videogramme / Install Composer using MAMP's PHP.md
Last active October 18, 2015 15:53 — forked from irazasyed/Install Composer using MAMP's PHP.md
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

##Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management

###Instructions to Change PHP Installation

First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@videogramme
videogramme / pseudo-elements.md
Created September 29, 2015 14:41 — forked from p3t3r67x0/pseudo_elements.md
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@videogramme
videogramme / gist:02f64c4fa4e4208e9449
Created March 29, 2015 12:05
backup bash rsync script
### https://linuxfr.org/forums/general-cherche-logiciel/posts/resolu-backup-oui-c-est-une-vielle-problematique ###
#!/bin/sh
date=`date "+%Y%m%d-T%H%M%S"`
# Attention au /
SOURCE_DIR=/home/denis/
TARGET_HOST=192.168.0.4
TARGET_USER=rsync
TARGET_DIR=/volume1/persosave/rsync/denis
@videogramme
videogramme / gist:37f0f7d457d6f861a8d1
Created January 29, 2015 16:01
Image magic thumb
mogrify -resize "210x" -background white -gravity center -extent 210x118 -format jpg -quality 75 "*.jpg"
@videogramme
videogramme / gist:7d482dff80bc0692ecd4
Last active August 29, 2015 14:12
Drupal8 admin password reset
php core/scripts/password-hash.sh 'your-new-pass-here'
$S$EWwvK89PQ09i2zsJVpU5kve68Yk4p1y724GTpUmmZL37sKEVsvuBxa
UPDATE users_field_data SET pass='$S$EWwvK89PQ09i2zsJVpU5kve68Yk4p1y724GTpUmmZL37sKEVsvuBxa' WHERE uid = 1;
DELETE FROM cache_entity WHERE cid = 'values:user:1';
@videogramme
videogramme / designer.html
Created November 19, 2014 19:42
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
<style>