Skip to content

Instantly share code, notes, and snippets.

View jacobmc's full-sized avatar

Jacob McKinney jacobmc

View GitHub Profile
@justingivens
justingivens / gist:c56b6c18fa5f36e0bead096208af6e11
Created March 9, 2021 05:58
WP CLI Search-Replace to launch Production
#Export a SQL to use to move into Production
wp search-replace '{{DEVELOP_URL}}' '{{PRODUCTION_URL}}' --all-tables --export=production.sql
@justingivens
justingivens / create-posts.txt
Created June 26, 2017 15:43
WP-CLI - Generate Posts with different post dates and different content
for i in {10..1}; do custom_date=$(date -v-${i}d "+%Y-%m-%d") && curl http://loripsum.net/api/5/headers/ul/bq | wp post generate --post_content --count=1 --post_date=$custom_date; done
@magnetikonline
magnetikonline / dumprequest.php
Last active April 30, 2024 08:01
PHP script to dump full HTTP request to file (method, HTTP headers and body).
<?php
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
class DumpHTTPRequestToFile {
public function execute($targetFile) {
$data = sprintf(
"%s %s %s\n\nHTTP headers:\n",
$_SERVER['REQUEST_METHOD'],
$_SERVER['REQUEST_URI'],
$_SERVER['SERVER_PROTOCOL']
@WebEndevSnippets
WebEndevSnippets / functions.php
Created March 3, 2014 19:50
Gravity Forms: Auto login to site after GF User Registration Form Submittal
add_action( 'gform_user_registered','we_autologin_gfregistration', 10, 4 );
/**
* Auto login to site after GF User Registration Form Submittal
*
*/
function we_autologin_gfregistration( $user_id, $config, $entry, $password ) {
wp_set_auth_cookie( $user_id, false, '' );
}
@gordonbanderson
gordonbanderson / PHP cleaner
Created February 27, 2012 09:01
Find leading and trailing space
<?php
/***********************
*@author: Ritesh Agrawal
*@description: Identifies php files that contain leading or trailing spaces before or after PHP opening or closings tags
*@version: 1.0
*@date: Nov 06, 2007
@todo – check only *.PHP or *.CTP files rather than checking all of the files
– html based output
***********************/
//Set Source Path
@ocean90
ocean90 / box-shadow.html
Last active April 11, 2024 13:54
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;