Skip to content

Instantly share code, notes, and snippets.

@DarylSmith
DarylSmith / gist:ff69ee75dc1bb61af44dc9b9d9e00d7a
Created July 2, 2020 21:09
Post-Deployment Script for finding unresolved references in database
/*
--------------------------------------------------------------------------------------
Stored Procedures are late-binding, so they will build even with references to non-existant objects, and will fail at runtime
This script attempts to find any missing references in a database, and can be run as a post deployment script in SSDT to
verify there are no unvalid references after a database has been deployed.
--------------------------------------------------------------------------------------
*/
DECLARE @ResultStr varchar(max)
DECLARE @ResultTable TABLE
@peltopiri
peltopiri / archive-product.php
Created March 27, 2019 12:38
WooCommerce - Nested Category/Subcategory Layout, FIXED: show subcategory content
<?php
/**
* The Template for displaying product archives, including the main shop page which is a post type archive
*
* This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
@jenssogaard
jenssogaard / ACF Gutenberg get block fields
Created February 22, 2019 21:08
Helper class for ACF and Gutenberg. Get blocks fields by passing block_id and post_id.
<?php
namespace JensSogaard;
class BlockHelper
{
/**
* Gets ACF fields for a specific block on a given post
* @author Jens Soegaard <jens@jenssogaard.com>
*/
public function getBlockFromPage(string $block_id, int $post_id)
@zanechua
zanechua / azure-pipelines.yml
Last active April 11, 2023 11:51
Azure Pipeline + Laravel + MySQL + PHPUnit + Laravel Dusk
# PHP
# Test and package your PHP project.
# Add steps that run tests, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/php
pool:
vmImage: 'Ubuntu 16.04'
variables:
phpVersion: 7.2
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# WordPress Coding Standards
# http://make.wordpress.org/core/handbook/coding-standards/
root = true
[*]
charset = utf-8
@chrismccoy
chrismccoy / gutenberg.txt
Last active April 4, 2024 20:34
Gutenberg Resources
How to parse Gutenberg content for headless WordPress
https://kinsta.com/blog/headless-wordpress-gutenberg/
Adding wrapper to Gutenberg’s Table block
https://helloadmin.com/adding-wrapper-to-gutenbergs-table-block/
Display specific Gutenberg blocks of a post outside of the post content in the theme
https://florianbrinkmann.com/en/display-specific-gutenberg-blocks-of-a-post-outside-of-the-post-content-in-the-theme-5620/
Modifying the Markup of a Core Block
@anova
anova / sqlpackage.md
Last active November 3, 2022 20:31
Sqlpackage.exe samples

Export

Creates a .bacpac file from live database.

"C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin\SqlPackage.exe" /a:Export /scs:"Data Source=SERVER;Initial Catalog=db_name;Integrated Security=False;Persist Security Info=False;User ID=db_user;Password=db_password" /tf:"D:\backup\database_backup.bacpac"

Import

Import from .bacpac file to database.

@Tiriel
Tiriel / encryption.js
Last active January 24, 2024 08:15
Symetric encryption/decryption for PHP and NodeJS communication
'use strict';
const crypto = require('crypto');
const AES_METHOD = 'aes-256-cbc';
const IV_LENGTH = 16; // For AES, this is always 16, checked with php
const password = 'lbwyBzfgzUIvXZFShJuikaWvLJhIVq36'; // Must be 256 bytes (32 characters)
function encrypt(text, password) {
@davebeach
davebeach / terms.md
Created June 1, 2017 16:16
Sample Terms and Conditions

Terms Of Use

Table of Contents

  1. Legal Notices
  2. Permitted and Prohibited Uses
  3. User Submissions
  4. User Discussion Lists and Forums
  5. Use of Personally Identifiable Information
  6. Indemnification
@Mo3g4u
Mo3g4u / vue2_manual_drag_and_drop.js
Created January 31, 2017 00:11
vue.js 2.0 manual drag drop sample
<h1>User List (sort)</h1>
<p><a href="{{ basePath }}/top">Top</a></p>
<p><a href="{{ basePath }}/user/add">Add</a></p>
<div id="userList">
<table border="1">
<thead>
<tr>
<th>■</th>