Skip to content

Instantly share code, notes, and snippets.

View hirasso's full-sized avatar
👋

Rasso Hilber hirasso

👋
View GitHub Profile
// Core assets
let coreAssets = [];
// On install, cache core assets
self.addEventListener('install', function (event) {
// Cache core assets
event.waitUntil(caches.open('app').then(function (cache) {
for (let asset of coreAssets) {
cache.add(new Request(asset));
@afragen
afragen / change-default-content-folder.php
Last active October 25, 2021 20:27
Use the 'gu_fix_repo_slug' filter to change the default wp-content folder name.
<?php
/**
* Usage of 'gu_fix_repo_slug' filter.
*
* @package wordpress-plugin
* @link https://github.com/afragen/git-updater/issues/971
*/
/**
* Plugin Name: Change Default Content Folder
@joshkautz
joshkautz / Replace TextEdit as the default macOS text editor.md
Last active November 10, 2024 21:18
Replace TextEdit as the default text editor

Replace TextEdit as the default text editor application for opening plain text files and files with no extensions on macOS.

Run the following command in the Terminal to find the bundle identifier for your desired text editor application:

$ osascript -e 'id of app "Visual Studio Code"'
com.microsoft.VSCode

$ osascript -e 'id of app "Sublime Text"'
com.sublimetext.3
@polevaultweb
polevaultweb / prefix-composer-autoloader-namespace.php
Last active October 31, 2024 19:10
Patch file to run after PHP Scoper to ensure the Composer Autoload namespace is prefixed
<?php
/**
* Make sure the Composer\Autoload namespace is prefixed.
* Needs to be run after php-scoper.
*
* `php ./patch-scoper-autoloader-namespace.php MY_PREFIX`
*/
if ( empty( $argv[1] ) ) {
return;
@Aidurber
Aidurber / cleanup.sh
Last active September 29, 2022 13:14
A handy script to clean up a mac thanks to - Gant Laborde's article: https://medium.freecodecamp.org/how-to-free-up-space-on-your-developer-mac-f542f66ddfb
# Cleanup old node_modules
echo "Cleaning node_modules in projects older than 30 days"
find . -name "node_modules" -type d -mtime +30 | xargs rm -rf
echo "Done cleaning node_modules"
# Clean up homebrew
echo "Clean homebrew"
brew update && brew upgrade && brew cleanup
echo "Done cleaning homebrew"
@fnky
fnky / ANSI.md
Last active November 16, 2024 01:32
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@amboutwe
amboutwe / yoast_seo_disable_single_post.php
Last active May 25, 2021 22:39
Remove Yoast from front end for a single post or page
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast from front end for a single post or page
* Credit: Dodinas https://stackoverflow.com/questions/37845968/disable-wordpress-yoast-seo-on-single-page
* Last Tested: Nov 08 2019 using Yoast SEO 12.4 on WordPress 5.2.4
* Note: For version 14+, please use the code here: https://developer.yoast.com/customization/yoast-seo/disabling-yoast-seo
*********
* DIFFERENT POST TYPES
* Post: Change 123456 to the post ID
* Page: Change is_single to is_page and 123456 to the page ID
@Ciantic
Ciantic / Indexer.php
Last active August 31, 2018 15:44
Fixing a PHP Language Server for my own taste
<?php
/**
* Will read and parse the passed source files in the project and add them to the appropiate indexes
*
* @return Promise <void>
*/
public function index(): Promise
{
return coroutine(function () {
@steven2358
steven2358 / ffmpeg.md
Last active November 11, 2024 04:45
FFmpeg cheat sheet
@butlerblog
butlerblog / functions.php
Last active September 24, 2024 21:50
SMTP using wp-config.php for settings #smtp #wp_mail
<?php // Don't use this line.
/*
* Add the script below to wherever you store custom code snippets
* in your site, whether that's your child theme's functions.php,
* a custom plugin file, or through a code snippet plugin.
*/
/**
* This function will connect wp_mail to your authenticated