Skip to content

Instantly share code, notes, and snippets.

@mrpatg
mrpatg / gist:6617930
Created September 19, 2013 01:10
Test
<?php
echo "Hello World.";
?>
@mrpatg
mrpatg / create.php
Last active May 19, 2017 00:39
jquery submit form pt1
<form id="create" action="create.php" method="POST">
<input name="url" type="text" />
<input type="submit" value="Submit" />
<div id="results"></div>
</form>
@mrpatg
mrpatg / create.js
Created May 19, 2017 00:30
jquery submit form pt2
$('#create').submit(function() { // stop the form's submit event
$.ajax({ // create a new AJAX call
data: $(this).serialize(), // grab all values/data from the form and prep it
type: $(this).attr('method'), // GET or POST
url: $(this).attr('action'), // the file to request, can be local or remote
success: function(response) { // on success
$('#results').html(response); // update the contents of the element.
}
});
return false; // cancel original event to prevent form submitting
@mrpatg
mrpatg / gist:98e7937baeb940f218470ec318ab6f66
Last active January 10, 2018 20:25
Vertical Hydroponic Garden
(5) 10' - 2" PVC pipe
(1) 10' - 3" PVC pipe
DELIVERED *(4) 2" PVC 90° elbow
DELIVERED *(8) 2" PVC tee
DELIVERED *(4) 3" to 2" PVC tee
DELIVERED *(4) 3" PVC endcaps
(10) 10' - 2" x 3" PVC downspouts
(1) 10' PVC extruded gutter 4"
(4) PVC gutter end caps (make sure to get 2 left and 2 right)
DELIVERED *(2) 1" threaded to 3/4" barbed adapter
@mrpatg
mrpatg / gist:8d3adbdc1d2be459175769f9c34e463f
Last active January 22, 2018 17:33
wp show post content
<?php
/**
* The Header for our theme
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="7zip.install" version="18.5.0.20180730" />
<package id="chocolatey" version="0.10.11" />
<package id="chocolatey-core.extension" version="1.3.3" />
<package id="chocolatey-windowsupdate.extension" version="1.0.2" />
<package id="chocolateygui" version="0.16.0" />
<package id="classic-shell" version="4.3.1.20180405" />
<package id="filezilla" version="3.36.0" />
<package id="golang" version="1.11.0" />
@mrpatg
mrpatg / .htaccess
Created April 5, 2019 00:35
.htaccess force https
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
@mrpatg
mrpatg / git-deployment.md
Last active April 6, 2019 17:01 — forked from noelboss/git-deployment.md
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, let's 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.

@mrpatg
mrpatg / palendrome.php
Created October 7, 2019 22:05
palendrome
<?php
function isPalendrome($input){
trim( $input );
$reverse = strrev( $input );
if($input == $reverse){
return TRUE;
} else {
return FALSE;
@mrpatg
mrpatg / discord.js
Created October 22, 2019 11:21
Discord - Hide Blocked Message Bar
/*
Open Discord desktop app and press CTRL+SHIFT+I.
Paste this whole thing into the console and press enter.
This will need to be repeated each time Discord is started/restarted.
*/
(function hideBlocked() {
// This script already existed, but the class names in Discord have changed. I modified it to work again.
document.querySelectorAll('[class^=messageGroupBlocked]').forEach(div => div.setAttribute("style", "display: none;"));