Skip to content

Instantly share code, notes, and snippets.

View BKeanu1989's full-sized avatar

Kevin Fechner BKeanu1989

View GitHub Profile
@bradtraversy
bradtraversy / docker_wordpress.md
Last active November 17, 2024 13:34
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@manix
manix / sample.js
Last active March 1, 2024 23:51
Improved "fieldSorter"
function fieldSorterOptimized(fields) {
var dir = [], i, l = fields.length;
fields = fields.map(function(o, i) {
if (o[0] === "-") {
dir[i] = -1;
o = o.substring(1);
} else {
dir[i] = 1;
}
return o;
@iamstoick
iamstoick / import.md
Created June 14, 2017 05:03
How to import database in MySQL in Docker?

This is a simple way of importing MySQL database in Docker.

  1. In you Dockerfile you must have a shared folder. Shared folder is a directory in your host machine that is mounted to Docker instance.

  2. Put the exported sql file in the shared folder.

  3. Login to your Docker instance via docker exec -it DOCKER_CONTAINER_ID bin/bash.

  4. Login to MySQL via mysql -u USERNAME -p.

@BKeanu1989
BKeanu1989 / live-to-local-wp.sql
Last active November 29, 2018 13:17
From live to local Wordpress
-- variables: PREFIX; URL; HTDOCS_DIR
-- TODO/TRY UPDATE PREFIXposts SET guid = replace(guid, 'URL', 'http://localhost:8888/HTDOCS_DIR');
UPDATE PREFIXoptions SET option_value = replace(option_value, 'URL', 'http://localhost:8888/HTDOCS_DIR') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE PREFIXposts SET post_content = replace(post_content, 'URL', 'http://localhost:8888/HTDOCS_DIR');
UPDATE PREFIXpostmeta SET meta_value = replace(meta_value, 'URL','http://localhost:8888/HTDOCS_DIR');
anonymous
anonymous / example_PDF_gen
Created April 14, 2016 12:35
/*
Generates a populated Job Card PDF using the data in the supplied array and returns an application file path to the newly generated PDF.
Requires the inclusion of the util function: 'generateJobCardFDF($inputData)'
*/
function generatePopulatedJobCardPDF($jobCardData){
//Format the form data
$formData['Job_Number']=$jobCardData[''];
$formData['Customer']=$jobCardData[''];
$formData['Description']=$jobCardData[''];
@manjeshpv
manjeshpv / passport.js
Last active February 29, 2024 15:11
Passport.js using MySQL for Authentication with Express
// config/passport.js
// load all the things we need
var LocalStrategy = require('passport-local').Strategy;
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',
@salcode
salcode / .gitignore
Last active February 10, 2024 10:56
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@corsonr
corsonr / gist:9152652
Last active January 19, 2023 22:41
WooCommerce : add custom fields to product variations
<?php
//Display Fields
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 3 );
//JS to add fields for new variations
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' );
//Save variation fields
add_action( 'woocommerce_process_product_meta_variable', 'save_variable_fields', 10, 1 );
/**
@chrisjhoughton
chrisjhoughton / proxy.apache.conf
Last active September 17, 2024 23:59
Sample Nginx reverse proxy to Apache set up for Wordpress.
<VirtualHost *:{PORT}>
ServerName www.yourdomain.com
ServerAdmin [email protected]
DocumentRoot /var/www/yourdir/
<Directory /var/www/yourdir>
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny