Skip to content

Instantly share code, notes, and snippets.

View farukgaric's full-sized avatar
🏀
Focusing

Faruk Garić farukgaric

🏀
Focusing
View GitHub Profile
@farukgaric
farukgaric / index.php
Created November 4, 2019 07:45
Simple php jwt response
<?php
if(!isset($_POST['username']) && !isset($_POST['password']) && empty($_POST['username'] && empty($_POST['password']))){
header("HTTP/1.1 401 Unauthorized");
exit;
}
if($_POST['username'] == 'admin' && $_POST['password'] == "admin123"){
// clear the old headers
header_remove();
@farukgaric
farukgaric / event_scheduled.html
Created March 25, 2020 18:32
Structured data: Just normal scheduled 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",
@farukgaric
farukgaric / event_cancelled.html
Created March 25, 2020 18:34
Structured data: Cancelled 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",
@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",
@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",
<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 / 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);
}
@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 / 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 / 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