Skip to content

Instantly share code, notes, and snippets.

View entity-providers.js
// Probably a file in core-data module
/**
* WordPress dependencies
*/
import { createContext, useContext } from '@wordpress/element';
import { useSelect, useDispatch } from '@wordpress/data';
const PostEntityContext = createContext( null );
const SiteEntityContext = createContext( null );
@youknowriad
youknowriad / gulpfile.js
Last active Jul 24, 2019
ES6 + ES5 Workflow gulpfile
View gulpfile.js
var gulp = require('gulp');
var browserify = require('browserify');
var babelify = require('babelify');
var del = require('del');
var source = require('vinyl-source-stream');
var _ = require('lodash');
var extReplace = require('gulp-ext-replace');
var less = require('gulp-less');
var gulpMerge = require('merge-stream');
var ngTemplates = require('gulp-ng-templates');
View backup_script.sh
#!/bin/bash
# ----
#
# Script de backup serveur perso vers serveur distant
# Fonctionnemenent :
# 1. Targz de /var/www
# 2. Dump de toutes les bases de données MySql
# 3. Zip du backup courant avec protection par mot de passe
# 4. Envoi sur serveur distant
@youknowriad
youknowriad / .anchour
Created Sep 15, 2012
Deploying Wordpress And Theme with anchour
View .anchour
anchour:
connections:
ftp_server:
type: "ftp"
options:
host: %ftp_host%
username: %ftp_username%
password: %ftp_password%
commands:
@youknowriad
youknowriad / Rpm.php
Created Sep 13, 2012
RpmQuery : A quick class to monitor installed Rpms with rpm -q
View Rpm.php
<?php
class Rpm
{
const FILED_SEPARATOR = ';;;';
const ROW_SEPARATOR = '|||';
public function listPackages()
{
$parameters = array('name', 'version', 'packager');
@youknowriad
youknowriad / pullrequest.sh
Created Sep 12, 2012
Checkout Pull Requests
View pullrequest.sh
git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"
git checkout pr/2
@youknowriad
youknowriad / signals.php
Created Sep 10, 2012
Callback for process signals in PHP
View signals.php
<?php
function callback() {
echo 'callback ...';
}
pcntl_signal(SIGTERM, 'callback');
pcntl_signal(SIGINT, 'callback');
You can’t perform that action at this time.