sudo apt install apache2
sudo ufw app list
sudo ufw allow in "Apache"
Run the following in the terminal:
Install the gcc-7 packages:
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7 -y
Set it up so the symbolic links gcc
, g++
point to the newer version:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I'm suggesting we add a new "adopt X from <Y />" syntax to the JSX language | |
// it would de-sugar to render prop children, but look and read better than | |
// what we currently have. For example: | |
// 1. | |
// this sugar | |
function MyComponent(props) { | |
adopt foo from <Bar />; | |
return <div>{foo}</div>; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Automatically clear Autoptimize cache if it goes beyond 2GB | |
if (class_exists('autoptimizeCache')) { | |
$myMaxSize = 2000000; # You may change this value to lower like 500000 for 500MB if you have limited server space | |
$statArr=autoptimizeCache::stats(); | |
$cacheSize=round($statArr[1]/1024); | |
if ($cacheSize>$myMaxSize){ | |
autoptimizeCache::clearall(); | |
header("Refresh:0"); # Refresh the page so that autoptimize can create new cache files and it does breaks the page after clearall. | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env node | |
'use strict'; | |
const program = require('commander'); | |
const fs = require('fs'); | |
const { spawn } = require('child_process'); | |
program | |
.version('1.0.0') | |
.option('-e, --environment <environment>', 'Environment to deploy to') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/kolodny/immutability-helper | |
/** Declaration extension point */ | |
declare namespace ImmutabilityHelper { | |
interface CustomOperators<T> { | |
/* $someShit?: T */ | |
/* $moreShit?: T */ | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Produces a dump on the state of WordPress when a not found error occurs */ | |
/* useful when debugging permalink issues, rewrite rule trouble, place inside functions.php */ | |
ini_set( 'error_reporting', -1 ); | |
ini_set( 'display_errors', 'On' ); | |
echo '<pre>'; | |
add_action( 'parse_request', 'debug_404_rewrite_dump' ); | |
function debug_404_rewrite_dump( &$wp ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How to ensure that our animation loop ends on component unount | |
componentDidMount() { | |
this.startLoop(); | |
} | |
componentWillUnmount() { | |
this.stopLoop(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
read -r -p "Would you really like to reset your development database and pull the latest from production? [y/N] " response | |
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then | |
wp @development db reset --yes && | |
wp @production db export - > sql-dump-production.sql && | |
wp @development db import sql-dump-production.sql && | |
wp @development search-replace https://example.com https://example.dev | |
fi |
You need to install ARMv5 gcc cross compiler: apt-get install gcc-arm-linux-gnueabi
You have to define a directory (via --prefix) where all of your binaries will be installed (copied). In the guide I use the following: /home/user/vpn_compile
- Download the source:
wget https://www.openssl.org/source/openssl-1.0.2j.tar.gz
NewerOlder