Skip to content

Instantly share code, notes, and snippets.

View shaunsantacruz's full-sized avatar

Shaun Santa Cruz shaunsantacruz

View GitHub Profile
@shaunsantacruz
shaunsantacruz / _verify-repair-permissions-disk.md
Created December 23, 2020 17:26 — forked from bzerangue/_verify-repair-permissions-disk.md
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@shaunsantacruz
shaunsantacruz / jwplayer_signed_url.php
Last active August 19, 2020 23:29
jwplayer_signed_url
<?php
function jwt_signed_url( string $resource_path, int $expires_at = null, string $host = "https://cdn.jwplayer.com" ) {
$expires_at = $expires_at ?? strtotime( '+2 hours' );
$header = json_encode( [
"alg" => "HS256",
"typ" => "JWT",
] );
import _invert from 'lodash/invert'
const filterSlugIdMap = {
//workout
'warm-up': 17,
'cool-down': 29,
'dance': 14,
'dynamic-stretch': 4,
'lower-body-strength': 9,
'upper-body-strength': 24,
@shaunsantacruz
shaunsantacruz / .gitignore
Last active November 28, 2017 17:33 — forked from salcode/.gitignore
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@shaunsantacruz
shaunsantacruz / aux-functions.php
Created March 30, 2017 15:39 — forked from eduwass/duplicate-post.php
Programmatically duplicating a WordPress post
<?php
/**
* Duplicates a post & its meta and it returns the new duplicated Post ID
* @param [int] $post_id The Post you want to clone
* @return [int] The duplicated Post ID
*/
function duplicate($post_id) {
$title = get_the_title($post_id);
$oldpost = get_post($post_id);
301 moved permanently (redirect):
<?php
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.example.com');
die();
?>
302 moved temporarily(redirect):
<?php
header('Location: http://www.example.com');
<?php
/**
* Plugin Name: ACF to CPT with Taxonony Terms
* Description:
*/
register_activation_hook(__FILE__, function () {
global $wpdb;
$i = 0;
var doctors = [
{ number: 1, actor: "William Hartnell", begin: 1963, end: 1966 },
{ number: 2, actor: "Patrick Troughton", begin: 1966, end: 1969 },
{ number: 3, actor: "Jon Pertwee", begin: 1970, end: 1974 },
{ number: 4, actor: "Tom Baker", begin: 1974, end: 1981 },
{ number: 5, actor: "Peter Davison", begin: 1982, end: 1984 },
{ number: 6, actor: "Colin Baker", begin: 1984, end: 1986 },
{ number: 7, actor: "Sylvester McCoy", begin: 1987, end: 1989 },
{ number: 8, actor: "Paul McGann", begin: 1996, end: 1996 },
{ number: 9, actor: "Christopher Eccleston", begin: 2005, end: 2005 },
@shaunsantacruz
shaunsantacruz / gist:bede47ac82cf551cfdd6
Created March 5, 2015 21:28
wordpress upload folder rewrite
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/
RewriteRule (.*) http://yoursite.com/wp-content/uploads/$1
</IfModule>
{
"user": {
"debug": true,
"delay": 1,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"php": {