Skip to content

Instantly share code, notes, and snippets.

View drmzio's full-sized avatar

Daniel Ramirez drmzio

View GitHub Profile
@drmzio
drmzio / Simple-HEX-color-generator.markdown
Created March 13, 2014 02:14
A Pen by Daniel Ramirez.

Simple HEX color generator

Don't know the HEX value of a certain color? Well, choose a color in the HTML5 color picker and click refresh to generate that color's HEX value!

A Pen by Daniel Ramirez on CodePen.

License.

@drmzio
drmzio / LEMP.sh
Created June 8, 2017 02:22 — forked from hiendnguyen/LEMP.sh
CentOS 7 LEMP
# Install Nginx
sudo yum install epel-release
sudo yum install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
# Install MySQL (MariaDB)
sudo yum install mariadb-server mariadb
sudo systemctl start mariadb
sudo systemctl enable mariadb
@drmzio
drmzio / gist:499528b722d37b8ae2ee5dcc9a21c912
Last active June 29, 2017 23:03 — forked from adampiotrowski/gist:ccf6342d9308a3abd897
Install LEMP (PHP 7.0, MariaDB) on Ubuntu 16.04
# Install updates
sudo apt-get update && sudo apt-get upgrade
# Update kernel
sudo apt-get update && sudo apt-get dist-upgrade
# Install LEMP
sudo apt-get update && sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://mariadb.kisiek.net//repo/10.0/ubuntu trusty main'
@drmzio
drmzio / README.md
Last active August 6, 2017 06:23
Finds the source of a video/image
@drmzio
drmzio / disable-emoji.php
Created June 19, 2018 20:00
Disables the ugly pixelated emojis that come with WordPress
<?php
function disable_wp_emoji() {
// all actions related to emojis
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
@drmzio
drmzio / Plugin.php
Last active February 13, 2022 09:47
October CMS RainLab.Blog media manager plugin extension
<?php
namespace Acme\BlogBanner;
use System\Classes\PluginBase;
use Event;
/**
* Class Plugin
*
@drmzio
drmzio / .env.example
Created February 25, 2019 20:35 — forked from LukeTowers/.0 - cheatsheet.sh
Introduction to OctoberCMS
APP_DEBUG=true
APP_URL=http://example.local
APP_KEY=
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=website-oc-example-LOCAL
DB_USERNAME=homestead
DB_PASSWORD=secret
@drmzio
drmzio / ID.js
Created April 5, 2019 22:39
ID - a unique ID/name generator for JavaScript
// Generate unique IDs for use as pseudo-private/protected names.
// Similar in concept to
// <http://wiki.ecmascript.org/doku.php?id=strawman:names>.
//
// The goals of this function are twofold:
//
// * Provide a way to generate a string guaranteed to be unique when compared
// to other strings generated by this function.
// * Make the string complex enough that it is highly unlikely to be
// accidentally duplicated by hand (this is key if you're using `ID`
.sr-only {
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
width: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
}
@drmzio
drmzio / getPages.js
Last active July 12, 2021 22:04
Get list of all pages using require.context
export const getPages = () => {
const ctx = require.context('./', true, /\.js$/);
return ctx
.keys()
.filter(page => !page.startsWith('./_')) // Filters out _app.js and _document.js
.map(page => {
page = page
.replace(/(\/index)?\.js$/i, '') // Removes the index.js files
.replace(/\.(\/)?/i, '/'); // Normalize the homepage directory to "/"