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 / 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 |

Realtime Notifications with ActionCable

In this episode we're going to be adding realtime notifications into your app using ActionCable. We've talked about notifications a few times in the past and we used AJAX polling for that. 95% of the time, polling is the solution that would be recommended for it.

But if you're looking for a good introduction into ActionCable then this is a decent one because we're only really using it for one way from the server side to the client side.

Getting started

So to get started we're starting with an app that has Bootstrap installed and then we created a Main controller with an index view which is where we will list our Notifications as for this example.

Before we generate our channels let's install a few things

@raketbizdev
raketbizdev / install_elasticsearch_osx.md
Created April 11, 2019 10:38 — forked from djonsson/install_elasticsearch_osx.md
OS X installation instructions for Elasticsearch + Kibana + Marvel

What is this?

Following this guide will set up a local Elasticsearch with Kibana and Marvel using Homebrew and Homebrew Cask

Prerequisites

If you already have Java installed on your system, skip steps Install Cask and Install Java

If you already have Java and Homebrew installed on your system, skip steps Prerequisites, start at Install Elasticsearch and Kibana after running $ brew update

Install Homebrew

  • $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@raketbizdev
raketbizdev / web-fonts-asset-pipeline.md
Created June 4, 2022 08:49 — forked from anotheruiguy/web-fonts-asset-pipeline.md
Custom Web Fonts and the Rails Asset Pipeline

Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.

Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.

As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.

The recommended way

Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.