Skip to content

Instantly share code, notes, and snippets.

View mandrasch's full-sized avatar

Matthias Andrasch mandrasch

View GitHub Profile
@rfay
rfay / brewlink_ddev.sh
Created April 5, 2024 13:57
ddev symlinking scripts
@fgeierst
fgeierst / Main.js
Created July 26, 2022 12:06
Islands architecture with TYPO3+Rollup+Svelte
import Test from './Test.svelte';
// Mount Svelte component
const test = new Test({
target: document.querySelector('#test')
});
@jonassiewertsen
jonassiewertsen / 1-example-deployer-script.yml
Last active June 30, 2022 13:59
Sharing some different scripts to use Deployer and GitHub actions
import:
- recipe/statamic.php
config:
application: 'statameet'
repository: 'git@github.com:jonassiewertsen/my-project-i-want-to-deploy.git'
# keep_releases: 3
shared_dirs:
# - public/img
# - .git
@patrickposner
patrickposner / functions.php
Last active April 3, 2024 14:09
Simply Static: Set up a build to run daily with cron.
<?php
register_activation_hook( __FILE__, 'setup_build_cron' );
/**
* Setup a cron job to run daily.
*
* @return void
*/
function setup_build_cron() {
@CapWebSolutions
CapWebSolutions / sec-scan-root.sh
Last active April 23, 2024 15:47
Latest iteration of security scanning script for MainWP instance.
#
# This script is executed from a terminal prompt at the root of your MainWP WordPress website.
# It uses the same services as WP CLI, so if WP CLI runs, this should also.
#
# Execute MainWP CLI command to generate a list of all configured sites in MainWP
# Pipe output through filter to remove columns 3 and 4 of output. These columns hold the 2 digit site number. Adjust if more than 99 sites.
# Pipe that output to get rid of the comment lines in the site listing.
# Pipe that output through the SED editor inserting the security scan command at the beginning of the line
# Send everything to a shell script to be executed.
cd /var/www/capwebwpcare.com/htdocs
@antstanley
antstanley / .eleventy.js
Last active September 12, 2022 21:43
Using PurgeCSS and CleanCSS with 11ty to remove unused CSS selectors
const Purgecss = require('purgecss')
const { JSDOM } = require('jsdom')
const CleanCSS = require("clean-css");
//array of css files to combine
const cssFiles = ['./src/css/custom.css','./src/css/markdown.css', './src/css/tachyons.css']
// cleanCSSOptions for minification and inlining css, will fix duplicate media queries
const cleanCSSOptions = {
level: {
@mtwalsh
mtwalsh / deploy.php
Last active December 8, 2022 16:31
Deployer recipe for Craft CMS 3 projects.
<?php
namespace Deployer;
require 'recipe/common.php';
// Project name
set('application', 'enovate.co.uk');
// Project repository
set('repository', 'git@githosting.com:enovatedesign/project.git');
@max-mapper
max-mapper / bibtex.png
Last active March 10, 2024 21:53
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@miya0001
miya0001 / cors-for-the-wordpress-rest-api.php
Last active January 31, 2023 07:42
CORS for the WordPress REST API
<?php
function my_customize_rest_cors() {
remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' );
add_filter( 'rest_pre_serve_request', function( $value ) {
header( 'Access-Control-Allow-Origin: *' );
header( 'Access-Control-Allow-Methods: GET' );
header( 'Access-Control-Allow-Credentials: true' );
header( 'Access-Control-Expose-Headers: Link', false );