Skip to content

Instantly share code, notes, and snippets.

View kimsible's full-sized avatar
🎯
Focusing

Ms Kimsible kimsible

🎯
Focusing
  • Nantes
View GitHub Profile
@kimsible
kimsible / main.php
Created September 15, 2020 11:39
WordPress - Snippet - Remove draft preview
if (is_admin()) {
function remove_draft_preview () {
?>
<style>
#minor-publishing-actions {
padding-top: 0;
}
#save-action #save-post, #save-action .spinner {
margin-top: 10px;
}
@kimsible
kimsible / main.php
Created September 15, 2020 11:36
WordPress - Snippet - Remove quick edit
function remove_quick_edit($actions) {
unset($actions['inline hide-if-no-js']);
return $actions;
}
if (!current_user_can('manage_options')) {
add_filter('page_row_actions', 'remove_quick_edit', 10, 1);
add_filter('post_row_actions', 'remove_quick_edit', 10, 1);
}
@kimsible
kimsible / main.php
Last active September 15, 2020 11:36
WordPress - Snippet - Disable content editor for specific pages
function disable_content_editor () {
$pages_ids = array(2); // add your page / post id here
if ($_GET['post']) {
$post_id = $_GET['post'];
} else {
$post_id = $_POST['post_ID'];
}
if (!isset($post_id)) return;
@kimsible
kimsible / readme.md
Created September 15, 2020 10:55
WordPress - plugins with frontity
  • Advanced Custom Fields (ACF) - useful for custom values like social medias and contact / home page fields
  • ACF to REST API
  • ACF Photo Gallery Field (Optionnal)
  • Classic Editor Addon - useful to disable new block editor (will install Classic Editor plugin)
  • Disable Comments
  • Simple Website Redirect - Redirect for pages links into Frontity
  • Roles & Capabilities - Create specific rôle for clients
  • Code Snippets
@kimsible
kimsible / main.php
Last active September 15, 2020 11:43
WordPress - Snippet - Remove unused profile edit page fields
if (is_admin() && !current_user_can('administrator')) {
add_action('profile_personal_options', 'remove_profile_fields');
function remove_profile_fields() {
?>
<style>
#your-profile h2, /* hide profile titles */
.user-rich-editing-wrap,
.user-syntax-highlighting-wrap,
.user-admin-color-wrap,
@kimsible
kimsible / docker-compose.yml
Last active May 31, 2020 17:59
PeerTube DEV - redis + postgres docker-compose
version: "3.3"
services:
postgres:
image: postgres:10-alpine
environment:
- POSTGRES_DB=peertube_dev
- POSTGRES_USER=peertube
- POSTGRES_PASSWORD=peertube
@kimsible
kimsible / README.md
Last active August 24, 2022 21:01
PeerTube admin tools for docker

Prerequisites

  • Domain Name
  • Main Dedicated Server
  • Private FTP Backups Server

General budget: from ~17€ to ~100€ per month

Domain Name

@kimsible
kimsible / .env
Created January 24, 2020 02:56
Docker-compose for a peertube production instance
PEERTUBE_DB_USERNAME=postgres_user
PEERTUBE_DB_PASSWORD=postgres_password
PEERTUBE_WEBSERVER_HOSTNAME=domain.tld
# If you need more than one IP as trust_proxy
# pass them as a comma separated array:
PEERTUBE_TRUST_PROXY=["127.0.0.1", "loopback", "172.18.0.0/16"]
#PEERTUBE_SMTP_USERNAME=
#PEERTUBE_SMTP_PASSWORD=
PEERTUBE_SMTP_HOSTNAME=postfix
PEERTUBE_SMTP_PORT=25
@kimsible
kimsible / README.md
Last active January 24, 2020 02:56
get-peertube

Setup PeerTube

Automatic production setup with docker-compose for a PeerTube instance.

Requirements

You must install docker and docker-compose.

You also must be logged as root for a full setup with systemd.

'use strict'
const crypto = require('crypto')
const path = require('path')
const mudb = require('mudb')
const { STORAGE, SALT } = process.env
let db