Skip to content

Instantly share code, notes, and snippets.

View sarahcssiqueira's full-sized avatar

Sarah Siqueira sarahcssiqueira

View GitHub Profile
@sarahcssiqueira
sarahcssiqueira / composer.json
Created October 15, 2024 18:38
This patch fixes an issue in the WordPress Coding Standards (WPCS) package where null values are passed to `trim()`, causing errors in PHP 8.x. It modifies the following files: - PrefixAllGlobalsSniff.php (line 280) - I18nSniff.php (line 194) - Sniff.php (line 1144)
"extra": {
"patches": {
"wp-coding-standards/wpcs": {
"Fix null trim() issue in multiple files": "patches/fix-null-trim-multi.patch"
}
}
}
name: Release
on:
push:
branches:
- main
tags:
- v*
jobs:
@sarahcssiqueira
sarahcssiqueira / Bootstrap - Rails 7
Created September 4, 2024 17:04 — forked from rubyandcoffee/Bootstrap - Rails 7
Bootstrap with Rails 7
Adding Bootstrap to Rails 7
Reference: https://www.linkedin.com/pulse/rails-7-bootstrap-52-importmap-md-habibur-rahman-habib/
INSTRUCTIONS
1. Add the following to Gemfile:
gem "bootstrap"
gem "sassc-rails"
@sarahcssiqueira
sarahcssiqueira / gulpfile.js
Created August 19, 2024 17:29
Gulp file for CSS only
const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass'));
const plumber = require('gulp-plumber');
const notify = require('gulp-notify');
function compileSass() {
return gulp
.src('src/assets/styles/*.scss')
.pipe(
plumber({
@sarahcssiqueira
sarahcssiqueira / VS Code settings.json
Last active August 14, 2024 18:18
Eslint, Prettier and VS Code settings for a React app project
{
"editor.tabSize": 4,
"editor.detectIndentation": false,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
@sarahcssiqueira
sarahcssiqueira / set-cookie-wordpress.php
Created May 19, 2024 19:18 — forked from devinsays/set-cookie-wordpress.php
How to set a cookie using PHP in WordPress
@sarahcssiqueira
sarahcssiqueira / .phpcs.xml
Created August 3, 2023 23:18
Workaround to handle PSR-4 && WordPress Coding Standards at same time
<?xml version="1.0"?>
<ruleset name="CS">
<description>PHPCS example</description>
<config name="testVersion" value="5.6-"/>
<exclude-pattern>vendor/*</exclude-pattern>
<arg value="ps"/>
<arg name="colors"/>
<arg name="parallel" value="100"/>
<arg name="extensions" value="php"/>
@sarahcssiqueira
sarahcssiqueira / webpack dependencies
Last active December 4, 2024 21:41
webpack.config.js for WordPress projects
{
"devDependencies": {
"@babel/cli": "^7.22.9",
"@babel/core": "^7.22.9",
"@babel/preset-env": "^7.22.9",
"@babel/preset-react": "^7.22.5",
"babel-loader": "^9.1.2",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"cross-env": "^7.0.3",
@sarahcssiqueira
sarahcssiqueira / le-ssl.conf
Created July 12, 2023 22:40
Fix error "Could not reverse map the HTTPS VirtualHost to the original"
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName domain-name.com
ServerAlias www.domain-name.com
DocumentRoot /var/www/domain-name
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
@sarahcssiqueira
sarahcssiqueira / Composer Dependencies and script to config path
Last active July 4, 2023 13:41
PHPCS config using Composer, VS Code
"scripts": {
"cstd": "./vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs",
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.7",
"wp-coding-standards/wpcs": "^2.3",
}