Skip to content

Instantly share code, notes, and snippets.

View farukgaric's full-sized avatar
🏀
Focusing

Faruk Garić farukgaric

🏀
Focusing
View GitHub Profile
i
me
my
myself
we
our
ours
ourselves
you
your
@farukgaric
farukgaric / http-status-codes.php
Created December 7, 2020 20:37 — forked from henriquemoody/http-status-codes.php
List of HTTP status codes in PHP
<?php
/**
* Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
*
* You may also want a list of unofficial codes:
*
* 103 => 'Checkpoint',
* 218 => 'This is fine', // Apache Web Server
* 419 => 'Page Expired', // Laravel Framework
@farukgaric
farukgaric / virtual_online_event_schemaorg.html
Created September 19, 2020 02:53
Virtual (Online) Event - Structured data - Schema.org - JSON-LD
<html>
<head>
<title>The Adventures of Kira and Morrison</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Event",
"name": "The Adventures of Kira and Morrison",
"startDate": "2025-07-21T19:00:00-05:00",
"endDate": "2025-07-21T23:00-05:00",
@farukgaric
farukgaric / plugin.php
Last active August 27, 2020 23:02
WordPress Block Patterns - Listicle
/**
* Plugin Name: FG Patterns
* Plugin URI: https://www.farukgaric.com/
* Description: Various block patterns
* Version: 1.0.0
* Author: Faruk Garic
* Author URI: https://www.farukgaric.com/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: fg-patterns
@farukgaric
farukgaric / person_microdata.html
Created May 10, 2020 17:56
Structured data - Person (microdata)
<section itemscope itemtype="http://schema.org/Person">
Hello, my name is
<span itemprop="name">John Doe</span>,
I am a
<span itemprop="jobTitle">Graduate research assistant</span>
at the
<span itemprop="affiliation">University of Dreams</span>
My friends call me
<span itemprop="additionalName">Johnny</span>
You can visit my homepage at
@farukgaric
farukgaric / person_jsonld.html
Created May 10, 2020 19:24
Structured data - Person (json-ld)
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Person",
"name": "John Doe",
"jobTitle": "Graduate research assistant",
"affiliation": "University of Dreams",
"additionalName": "Johnny",
"url": "http://www.example.com",
"address": {
@farukgaric
farukgaric / function.php
Created March 26, 2020 10:19
Here is a simple snippet by @pbosakov that needs to be placed in function.php file in order to move all your events online due to COVID-19.
/* all events moved online due to COVID-19 */
if (!function_exists('custom_event_schema_extras')) {
function custom_event_schema_extras($_data, $args, $event) {
$_data->eventStatus = 'EventMovedOnline';
$_data->eventAttendanceMode = 'OnlineEventAttendanceMode';
return $_data;
}
add_filter('tribe_json_ld_event_object', 'custom_event_schema_extras', 10, 3);
}
<html>
<head>
<title>The Adventures of Kira and Morrison</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Event",
"name": "The Adventures of Kira and Morrison",
"startDate": "2025-08-21T19:00",
"endDate": "2025-08-21T23:00",
@farukgaric
farukgaric / event_rescheduled.html
Last active March 25, 2020 18:38
Structured data: Event rescheduled
<html>
<head>
<title>The Adventures of Kira and Morrison</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Event",
"name": "The Adventures of Kira and Morrison",
"startDate": "2025-08-21T19:00",
"endDate": "2025-08-21T23:00",
@farukgaric
farukgaric / event_postponed.html
Created March 25, 2020 18:35
Structured data: Postponed event
<html>
<head>
<title>The Adventures of Kira and Morrison</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Event",
"name": "The Adventures of Kira and Morrison",
"startDate": "2025-07-21T19:00",
"endDate": "2025-07-21T23:00",