Skip to content

Instantly share code, notes, and snippets.

@codex73
codex73 / update.sh
Created March 27, 2018 23:57 — forked from diogoca/update.sh
How to install Apache 2.4 and PHP 5.6 on Amazon Linux
# AWS EC2
# Remove Apache and PHP old version
# Install Apache 2.4, Mod_SSL and PHP 5.6
#
sudo service httpd stop
sudo yum erase httpd httpd-tools apr apr-util
sudo yum remove php-*
sudo yum install php56
sudo yum install php56-xml php56-xmlrpc php56-soap php56-gd php56-mbstring
sudo yum install php56-mysqlnd
@codex73
codex73 / createChroot.sh
Created May 22, 2018 00:53 — forked from kmddevdani/createChroot.sh
Creates chrooted user with real scp and ssh access on a amazon linux ec2 instance
#!/bin/bash
#
# This script creates a chrooted user, scp enabled, on an Amazon Linux aws instance
#
# 2017-10-05
#
# change username and password here:
username="abc"
@codex73
codex73 / install.sh
Created June 17, 2018 15:07
Installs LAMP with PHP 5.6 on Ubuntu 16.04
#!/bin/bash
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y apache2
sudo ufw allow in "Apache Full"
sudo apt-get install -y mysql-server
# After running this command, select (Y), option 2, then (Y) for the rest of the prompts.
sudo mysql_secure_installation
@codex73
codex73 / criticalcss-bookmarklet-devtool-snippet.js
Created December 21, 2018 16:37 — forked from PaulKinlan/criticalcss-bookmarklet-devtool-snippet.js
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@codex73
codex73 / breadcrumbs-functions.php
Created January 3, 2019 21:00 — forked from tinotriste/breadcrumbs-functions.php
Wordpress: Breadcrumbs function
<?php
/*=============================================
= BREADCRUMBS =
=============================================*/
// to include in functions.php
function the_breadcrumb() {
$sep = ' > ';
@codex73
codex73 / breadcrumbs-custom.php
Created January 8, 2019 21:02 — forked from hemusyl/breadcrumbs-custom.php
WordPress custom breadcrumbs without plugin
http://www.qualitytuts.com/wordpress-custom-breadcrumbs-without-plugin/
Step 1
Breadcrumbs are the important part of our website, in wordpress there are several plugins are available for this, but below i posted
the code for custom breadcrumbs for our wordpress site. Just add this below code in to your current wordpress theme functions.php
and call the second step.
<?php
function qt_custom_breadcrumbs() {
@codex73
codex73 / README.md
Created February 12, 2019 20:42 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@codex73
codex73 / ajax.js
Created June 7, 2019 02:49 — forked from franz-josef-kaiser/ajax.js
AJAX in WordPress. Class based example.
( function( $, plugin ) {
"use strict";
// Working with promises to bubble event later than core.
$.when( someObjectWithEvents ).done( function() {
console.log( 'AJAX request done.' );
} )
.then( function() {
setTimeout( function() {
console.log( 'AJAX requests resolved.' );
@codex73
codex73 / varnish-cheatcheet.md
Created October 12, 2019 19:49 — forked from VMBindraban/varnish-cheatcheet.md
Varnish 3 cheatsheet

###Some don't work yet.

Get the top request methods

varnishtop -i RxRequest

Top urls that missed the cache.

varnishtop -i TxURL

@codex73
codex73 / .gitignore
Created December 21, 2019 22:42 — forked from salcode/.gitignore
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore