Skip to content

Instantly share code, notes, and snippets.

View giorgioriccardi's full-sized avatar
🎯
Focusing

Giorgio Riccardi giorgioriccardi

🎯
Focusing
  • Giorgio Riccardi Creations
  • Vancovuer, BC, Canada
View GitHub Profile
@giorgioriccardi
giorgioriccardi / functions.php
Created September 21, 2020 02:57
WordPess add a script only for a specific page
<?php
/********************************************************/
// Add GameMaker scripts in WordPress <head>
/********************************************************/
add_action('wp_head', 'ssws_Add_GameMaker_scripts');
function ssws_Add_GameMaker_scripts() {
// wrap the videogame code in an if() condition to match only a certain condition(s):
// if (is_page( 42 )) { // match page ID, less flexible
if (is_page( 'games' )) { // match page slug
// https://developer.wordpress.org/reference/functions/is_page/#user-contributed-notes
@giorgioriccardi
giorgioriccardi / wordpress-db-roles-capabilities.md
Last active July 20, 2020 17:56 — forked from octalmage/roles.md
Default WordPress user roles and capabilities.

WordPress v4.3.1

Admin wp_capabilities wp_user_level 10

a:1:{s:13:"administrator";b:1;}

Contributor wp_capabilities wp_user_level 1

SHORTCUTS

Key/Command Description
Tab Auto-complete files and folder names
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + U Clear the line before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + W Delete the word before the cursor
Ctrl + T Swap the last two characters before the cursor
@giorgioriccardi
giorgioriccardi / core-blocks.txt
Created January 18, 2020 18:41 — forked from DavidPeralvarez/core-blocks.txt
Gutenberg core blocks list
// Útil para filtros de Gutenberg como "allowed_block_types"
archives
audio
button
categories
code
column
columns
coverImage
@giorgioriccardi
giorgioriccardi / vscode_shortcuts.md
Created January 3, 2020 16:33 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@giorgioriccardi
giorgioriccardi / wp-content-task-runner.php
Last active September 21, 2019 07:41
WP scraper/importer via API call, a rough proof of concept. Do NOT use into production or live environments!
<?php
// allow direct access to the file via front-end
// http://twentyninteen.local/wp-content/themes/twentynineteen/wp-content-task-runner.php
$path = preg_replace('/wp-content.*$/', '', __DIR__);
require_once $path . 'wp-load.php';
// test that we get some content
// var_dump(get_post(1));
// A collection of all APIs available:
@giorgioriccardi
giorgioriccardi / wl-api.php
Last active August 26, 2019 18:54 — forked from ivandoric/wl-api.php
Creating WordPress Rest API Custom Endpoints
<?php
/**
* Plugin Name: Custom API
* Plugin URI: http://chrushingit.com
* Description: Crushing it!
* Version: 1.0
* Author: Art Vandelay
* Author URI: http://watch-learn.com
* YouTube URI: https://www.youtube.com/watch?v=C2twS9ArdCI
*/
@giorgioriccardi
giorgioriccardi / Update cached .gitignore
Last active August 12, 2019 22:40 — forked from c33k/Update .gitignore
Updating .gitignore and cleaning the cache
// First commit any outstanding code changes, and then, run this command:
git rm -r --cached .
// This removes any changed files from the index(staging area), then just run:
git add .
// Commit
git commit -m "Remove .gitignore cached files"
@giorgioriccardi
giorgioriccardi / docker_wordpress.md
Created January 24, 2019 16:40 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@giorgioriccardi
giorgioriccardi / webdev_online_resources.md
Created August 24, 2018 00:09 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)