Skip to content

Instantly share code, notes, and snippets.

View raketbizdev's full-sized avatar
🏠
Party Party

Ruel Nopal raketbizdev

🏠
Party Party
View GitHub Profile
@raketbizdev
raketbizdev / php-html-css-js-minifier.php
Created October 20, 2015 08:31 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {
<?php
class WP_HTML_Compression {
protected $compress_css = true;
protected $compress_js = true;
protected $info_comment = true;
protected $remove_comments = true;
protected $html;
public function __construct($html) {
if (!empty($html)) {

Sed Cheat Sheet

Sed command line options

sed [options] sed-command [input-file]
Option Description Example
@raketbizdev
raketbizdev / deploy.php
Created February 15, 2018 17:06 — forked from oxguy3/deploy.php
Script used to automatically deploy from GitHub to a cPanel shared hosting server
<?php
/**
* deploy.php by Hayden Schiff (oxguy3)
* Available at https://gist.github.com/oxguy3/70ea582d951d4b0f78edec282a2bebf9
*
* No rights reserved. Dedicated to public domain via CC0 1.0 Universal.
* See https://creativecommons.org/publicdomain/zero/1.0/ for terms.
*/
// random string of characters; must match the "Secret" defined in your GitHub webhook
@raketbizdev
raketbizdev / _flash_messages.html.erb
Last active March 8, 2018 19:42
Updated Rails flash messages using Bootstrap 4 from https://gist.github.com/roberto/3344628
<% flash.each do |type, message| %>
<div class="alert alert-<%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
<%= form_with(model: document, local: true) do |form| %>
<% if document.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(document.errors.count, "error") %> prohibited this document from being saved:</h2>
<ul>
<% document.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
@raketbizdev
raketbizdev / newrelic.ini
Created June 26, 2018 05:15 — forked from polds/newrelic.ini
/etc/php.d/newrelic.ini
extension = "newrelic.so"
newrelic.license = "LICENSE_KEY"
newrelic.logfile = "/var/log/newrelic/php_agent.log"
newrelic.appname = "Kyani MODx; backoffice-modx; ${DESIGNATION}-backoffice"
newrelic.capture_params = true
newrelic.attributes.enabled = true
newrelic.daemon.logfile = "/var/log/newrelic/newrelic-daemon.log"
newrelic.framework = "no_framework"
@raketbizdev
raketbizdev / .htaccess
Created September 26, 2018 13:45 — forked from jonathonbyrdziak/.htaccess
htaccess mod_expires / mod_cache / mod_deflate / mod_headers
# ------------------------------------------------------------------------------
#
# Curtousy of the Magento Support Center
# http://magentosupport.help/what-are-expires-headers-and-how-do-i-implement-them/
#
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# | Mod Caching via Apache |
<?php
/**
* Gravity Forms Paynamics Add-On.
*
* @since 1.0
* @package GravityForms
* @author Rocketgenius
* @copyright Copyright (c) 2009 - 2018, Rocketgenius
*/
public function init() {
filter( 'gform_field_content', array( $this, 'add_paynamics_inputs' ), 10, 5 );
add_action( 'gform_after_submission', array( $this, 'paynamics_after_submission' ), 10, 3 );