Skip to content

Instantly share code, notes, and snippets.

View justindocanto's full-sized avatar

Justin DoCanto justindocanto

  • The Lender Marketing Group
  • California
View GitHub Profile
@danielstgt
danielstgt / imagick3.4.4-PHP7.4-forge.sh
Last active April 19, 2024 11:33
Install ImageMagick / Imagick 3.4.4 on PHP 7.4 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.4.tgz
tar xvzf imagick-3.4.4.tgz
@voluntas
voluntas / sysctl.conf
Created October 14, 2017 13:07 — forked from techgaun/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
<?php
/*
This script will allow you to send a custom email from anywhere within wordpress
but using the woocommerce template so that your emails look the same.
Created by [email protected] on 27th of July 2017
Put the script below into a function or anywhere you want to send a custom email
*/
@martijn94
martijn94 / wp-admin-add-posts-state.php
Last active November 28, 2024 13:43
Snippet to add post state to a WordPress page
<?php
//======================================================================
// Add post state to the projects page
//======================================================================
add_filter( 'display_post_states', 'ecs_add_post_state', 10, 2 );
function ecs_add_post_state( $post_states, $post ) {
@justindocanto
justindocanto / gist:42423d28b735a407b812
Last active August 29, 2015 14:22
Use WordPress functions within Magento
<?php
// I do a lot of websites where the client would like the ease of WordPress for a blog and
// for regular pages, but want something enterprise level for the e-commerce portion of
// their site. In order to service this need, I usually setup a wordpress site as the main
// site and then setup Magento as a secondary site at something like example.com/shop/.
// Then, I use the following 'hack' in order to use WP elements from within Magento so I
// don't have to do twice the work and/or so the client, if they are managing the site
// themselves, don't have to change things in two places. For example, you can use WordPress
// nav menus within Magento, so that you don't have to maintain 2 menus. You can also call
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@alex3305
alex3305 / index.php
Last active November 12, 2019 07:30
HTML to PDF converter with marginless cover page with Snappy and PDF Merge
<?php
/**
* PDF exporter for Mediawiki. This will load a specified content page and
* will append a seperate, specified cover page to the returning document.
*
* Requirements:
* - PHP 5.1+
* - wkhtmltox (wkhtmltopdf) 0.12+ (http://www.wkhtmltopdf.org)
* - KnpLabs Snappy (https://github.com/KnpLabs/snappy/)
* - PDF Merger for PHP (http://pdfmerger.codeplex.com/)
@mrsonord
mrsonord / functions.php
Last active August 11, 2022 19:11
Disable and remove individual jetpack features.
//To use place the function at the bottom of your functions.php file in the root of your wordpress installation directory.
function jherve_kill_monitor ( $modules ) {
unset( $modules['monitor'] );
return $modules;
}
add_filter( 'jetpack_get_available_modules', 'jherve_kill_monitor' );
function jherve_kill_sso ( $modules ) {
unset( $modules['sso'] );
return $modules;
@rileypaulsen
rileypaulsen / Force make_clickable() to generate target="_blank" links
Last active May 25, 2022 02:34
extend WordPress's make_clickable function to have target="_blank"
@Maksold
Maksold / local.xml
Last active May 28, 2021 20:02
#magento #xml - local.xml boilerplate
<?xml version="1.0"?>
<layout>
<default>
<!--Root/Default Layouts-->
<reference name="root">
<!--Appending Block-->
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
</reference>
<!--CSS and JS Files-->