Skip to content

Instantly share code, notes, and snippets.

View coccoinomane's full-sized avatar
🎯
Focusing

coccoinomane coccoinomane

🎯
Focusing
View GitHub Profile
@rheinardkorf
rheinardkorf / Hooks.js
Last active April 2, 2024 09:49
Simple WordPress like hooks system for JavaScript.
/**
* @file A WordPress-like hook system for JavaScript.
*
* This file demonstrates a simple hook system for JavaScript based on the hook
* system in WordPress. The purpose of this is to make your code extensible and
* allowing other developers to hook into your code with their own callbacks.
*
* There are other ways to do this, but this will feel right at home for
* WordPress developers.
*
@jaibeee
jaibeee / brew-perms.sh
Last active February 15, 2024 22:49
Configure homebrew permissions to allow multiple users on MAC OSX. Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
#!/bin/sh
# Configure homebrew permissions to allow multiple users on MAC OSX.
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
# allow admins to manage homebrew's local install directory
chgrp -R admin /usr/local
chmod -R g+w /usr/local
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew
@cfaria
cfaria / migrateorders.php
Last active February 12, 2024 16:45 — forked from maddisondesigns/migrateorders.php
Migrate WooCommerce Orders
<?php
//increase max execution time of this script to 150 min:
ini_set('max_execution_time', 9000);
//increase Allowed Memory Size of this script:
ini_set('memory_limit','960M');
// Copies woocommerce orders and users over from source to target.
// I use this on my local machine - loading both db's up there side by side
// could easily adjust the connect strings to connect elsewhere if needed.
@65
65 / gamselect.sh
Last active January 23, 2024 10:59
Helper file for for Google Workspace (GSuite) Resellers using GAMADV-XTD3 and need to swap between resold customers regularly
#!/bin/bash
#
#
# Author: Duncan Isaksen-Loxton
# Web: sixfive.com.au
#
# PREREQUISITES
@pgrandinetti
pgrandinetti / automatic_websocket_reconnect.py
Last active January 22, 2024 21:55
Automatic reconnect from websockets
import socket
import asyncio
import websockets
import time
import logging
import argparse
import threading
import sys
@ethicka
ethicka / wp-start.sh
Last active December 27, 2023 07:10
WordPress Installation with the Roots/Sage Framework and VirtualHost Creation
#!/bin/bash -e
##
# WordPress Installation and VirtualHost Creation
#
# Description: Installs a WordPress website in the ~/Sites folder, creates a homepage,
# cleans up the WP install a bit, deletes the akismet and hello dolly plugins, creates the permalinks,
# clones the roots/sage theme framework to the theme folder, deletes all the other WP default themes,
# installs/runs npm and bower and runs gulp to create the initial assets, adds a custom gitignore file
# to /wp-content, installs the roots/soil plugin, creates a git repo in wp-content, saves the WordPress
@JoelLisenby
JoelLisenby / vt_resize.php
Last active December 23, 2023 04:33 — forked from seedprod/vt_resize.php
Resize WordPress images on the fly vt_resize w/ multisite support
<?php
/*
* Resize images dynamically using wp built in functions.
* Update: Use WP_Image_Editor class instead of deprecated image_resize.
* Updated by Joel Lisenby (original function by Victor Teixeira)
*
* php 5.2+
*
* Example use:
*
@seedprod
seedprod / vt_resize.php
Created November 15, 2011 14:45
Resize WordPress images on the fly vt_resize w/ multisite support
<?php
/*
* Resize images dynamically using wp built in functions
* Victor Teixeira
*
* php 5.2+
*
* Exemplo de uso:
*
* <?php
@justintadlock
justintadlock / register-post-type.php
Last active October 22, 2023 05:55
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/