Skip to content

Instantly share code, notes, and snippets.

View radosek's full-sized avatar
💯

Radoš radosek

💯
View GitHub Profile
@joshmoto
joshmoto / DynamicRouter.lib.php
Created November 19, 2020 21:33
Dynamic Router Class for Wordpress
<?php
/**
* @author joshmoto <https://stackoverflow.com/users/888894/joshmoto>
*/
class DynamicRouter {
protected static
/**
@cptiwari20
cptiwari20 / ThriveCart Webhook Handler
Created September 14, 2020 16:35
Handle Thrivecart events in Node.js Expressjs API
const Subscriptions = require("../models/subscriptions"); //Any Subscription Model
const Users = require("../models/users"); // User Model
const Plans = require("../models/plans"); // Plans Model
const Payments = require('../models/payments')
const { send: sendMail } = require('../services/smtp');
const { generatePassword, getExpiryDate } = require('../utils/helpers');
let thrivecart_secret = process.env.THRIVECART_SECRET; //Add your API Secret in .env file
@jackdomleo7
jackdomleo7 / Useful_global_CSS.css
Last active September 22, 2025 05:17
A set of useful global CSS defaults to add to your site alongside a reset stylesheet (with explanations)
/*! NOTE: These are just recommended default global styles, edit as required */
@import ('Import reset stylesheet here, (I recommend modern-normalize) or even better, import the reset stylesheet in the HTML as the first imported stylesheet');
::selection { /* Optional */
/* It can be really hard to read highlighted text with a text-shadow, it should be removed when selected */
text-shadow: none;
/* NOTE: Using this means the color and background-color are set to transparent for selected text... */
/* So you can customise your styles below */
@yankiara
yankiara / oxygen-repeater-dynamic-query.php
Last active May 29, 2025 17:34
Use dynamic queries with Oxygen's repeater
/* I'll put here different examples of dynamic query for Oxygen repeater :
* - Use one of the following repeater_dynamic_query definitions
* in code block just BEFORE the repeater
* - Set the repeater custom query settings : post type, number of posts, order...
* - Add the remove_action in a code block AFTER the repeater
*/
/****************************************************************************************************
* Display related posts for any CPT with taxonomy:
@gaearon
gaearon / index.html
Last active October 21, 2025 03:08
Multiple React components on a single HTML page
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
@MollsReis
MollsReis / .babelrc
Last active May 23, 2021 05:35
Preact docker-compose boilerplate
{
"presets": ["env", "stage-2"],
"plugins": [
["transform-react-jsx", { "pragma": "h" }]
]
}
use Carbon_Fields\Container;
use Carbon_Fields\Field;
add_action( 'carbon_fields_register_fields', 'crb_attach_theme_options' );
function crb_attach_theme_options() {
Container::make( 'theme_options', __( 'Theme Options', 'crb' ) )
->add_fields( array(
Field::make('text', 'crb_text', 'Text Field' ),
Field::make('association', 'crb_association', 'Association'),
Field::make('checkbox', 'crb_checkbox', 'Checkbox')
@robertuniqid
robertuniqid / example.php
Last active August 5, 2022 14:11
EDD - Bundle License to emulate the normal licenses.
<?php
add_action( 'init', function() {
if( !isset( $_GET['edd_action'] ) && !isset( $_POST['edd_action'] ) )
return;
if( !isset( $_GET[ 'license' ] ) || !isset( $_GET[ 'item_id' ] ) )
if( !isset( $_POST[ 'license' ] ) || !isset( $_POST[ 'item_id' ] ) )
return;
@analogic
analogic / docker-compose.yml
Last active July 25, 2025 16:24
Poste.io (with Lets Encrypt) + Nginx reverse proxy + Nginx Lets encrypt companion
version: '3'
services:
nginx-proxy:
image: jwilder/nginx-proxy
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
container_name: nginx-proxy
restart: unless-stopped
ports:
@ismasan
ismasan / css_grid_draggable.html
Last active May 28, 2024 16:08
Example for reordering CSS grids layout
<html>
<head>
<title>grid</title>
<style>
body {padding: 0; margin: 0;}
.container {
display: grid;
grid-template-rows: 200px repeat(4, 100px);
grid-template-columns: repeat(4, 1fr);
grid-template-areas: "header header header header"