Skip to content

Instantly share code, notes, and snippets.

View chooomedia's full-sized avatar

chooom chooomedia

View GitHub Profile
@flymke
flymke / custom.js
Created November 21, 2023 23:13
santapress open modal by url param
jQuery(document).ready(function( $ ){
$(window).load(function() {
var searchParams = new URLSearchParams(window.location.search);
if(searchParams.has('sp_door_post')) {
var sp_door_post = searchParams.get('sp_door_post');
var $door = $('.santapress-container').find('[data-postid='+sp_door_post+'] a.santapress-modal');
$door.click();
}
});
});
@markhowellsmead
markhowellsmead / getTemplatePart.php
Last active September 25, 2021 22:42
Alternative to WordPress' get_template_part function , which allows you to pass data to the template part. Requires PHP 7+ because of the coalescing operator. Info at https://permanenttourist.ch/2019/10/passing-data-to-wordpress-template-parts/
<?php
public function getTemplatePart(string $file_path, ...$arguments)
{
$data = [];
// Array containing possible paths to the template part
$parts = (array) $file_path;
if (is_array($arguments)) {
@irazasyed
irazasyed / homebrew-permissions-issue.md
Last active December 9, 2025 04:49
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*