Skip to content

Instantly share code, notes, and snippets.

@erikvw
erikvw / odbc_on_mac.md
Last active May 12, 2024 17:27
mysql, ODBC, STATA 16 on MAC (M1 Silicon)
<?php
/**
* Plugin Name: WooCommerce Composite Products - Hide Components in all Templates
* Plugin URI: https://woocommerce.com/products/composite-products/
* Description: Use this snippet to hide Components in the cart, checkout, order and e-mail templates.
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Developer: Manos Psychogyiopoulos
*
@sharedphysics
sharedphysics / deploy-hugo-on-github.sh
Last active December 18, 2021 19:30
Automating Hugo Deployment on GitHub Pages
#!/bin/sh
############
# The following script is to help automate deployment of hugo sites on github pages.
# If you're just getting started, I recommend reading my full notes here:
# https://www.romandesign.co/setting-up-a-hugo-static-site-on-github/
#
# To run it, make sure you have made some site updates to deploy and via terminal in your backend and save the code in your hugo backend repo.
# Then type the following (no $):
#
@alexander-young
alexander-young / functions.php
Created January 15, 2020 05:27
Cleanup WordPress plugin admin
// Removing plugin controls from admin
function remove_plugin_controls($actions, $plugin_file, $plugin_data, $context){
if (array_key_exists('edit', $actions)) {
unset($actions['edit']);
}
if (array_key_exists('deactivate', $actions)) {
@gnanet
gnanet / wpai-run-imports.sh
Created January 29, 2018 01:17 — forked from onnimonni/wpai-run-imports.sh
Helper bash script which you can use to run wp all import synchronously. This also outputs problems which you may have with wpai.
#!/bin/bash
##
# Script to run WP All Import scripts sychronously with cron
##
# This is default wp core directory for us
ABSPATH="/var/www/project/wp"
function usage()
{
@dawidurbanski
dawidurbanski / wordpress-install.sh
Last active October 4, 2022 19:37
Install wordpress with wp-cli using Bedrock installation
#!/bin/bash
# webiste info
WP_TITLE=${WP_SITENAME//\"/}
WP_HOME=$WP_HOME
WP_USER=$WP_ADMIN_NAME
WP_PASSWORD=$WP_ADMIN_PASS
WP_EMAIL=$WP_ADMIN_EMAIL
# install
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active November 7, 2025 16:17
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@deflume1
deflume1 / ghost nginx config
Created March 20, 2017 22:05
Sample Ghost NGINX config file
# map of content type -> expires header
map $sent_http_content_type $expires {
default off;
text/html epoch;
text/css max;
application/javascript max;
~image/ max;
}
# listen for BS traffic on 80 that lacks a hostname, and just serve
@dsturm
dsturm / fix-wordpress-permissions.sh
Last active July 29, 2023 06:29 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions (for bedrock)
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_ROOT=$1 # <-- wordpress root directory
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
@noelboss
noelboss / git-deployment.md
Last active August 12, 2025 18:16
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.