Skip to content

Instantly share code, notes, and snippets.

@toofff
toofff / sphp.sh
Created Aug 2, 2017 — forked from w00fz/sphp.sh
PHP switcher
View sphp.sh
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
@toofff
toofff / README.md
Created Mar 4, 2020 — forked from hofmannsven/README.md
Git Cheatsheet
View README.md
@toofff
toofff / webpack.config.js
Created Mar 9, 2020 — forked from versedi/webpack.config.js
Webpack Encore + Sass + MiniCSSExtractPlugin + PurgeCSS + OptimizeCss + Babel + Typescript
View webpack.config.js
/* eslint-disable no-useless-escape */
const Encore = require('@symfony/webpack-encore');
const TerserPlugin = require('terser-webpack-plugin');
const CircularDependencyPlugin = require('circular-dependency-plugin');
const HtmlCriticalWebpackPlugin = require('html-critical-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const PurgeCssPlugin = require('purgecss-webpack-plugin');
const WebpackBar = require('webpackbar');
const path = require('path');
@toofff
toofff / webpack.config.js
Created Mar 9, 2020 — forked from versedi/webpack.config.js
Webpack Encore + Sass + MiniCSSExtractPlugin + PurgeCSS + OptimizeCss + Babel + Typescript
View webpack.config.js
/* eslint-disable no-useless-escape */
const Encore = require('@symfony/webpack-encore');
const TerserPlugin = require('terser-webpack-plugin');
const CircularDependencyPlugin = require('circular-dependency-plugin');
const HtmlCriticalWebpackPlugin = require('html-critical-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const PurgeCssPlugin = require('purgecss-webpack-plugin');
const WebpackBar = require('webpackbar');
const path = require('path');
@toofff
toofff / nginx.conf
Created Sep 28, 2020 — forked from weapp/nginx.conf
Return common errors as json in Nginx
View nginx.conf
error_page 500 /500.html;
location /500.html{
return 500 '{"error": {"status_code": 500,"status": "Internal Server Error"}}';
}
error_page 502 /502.html;
location /502.html{
return 502 '{"error": {"status_code": 502,"status": "Bad Gateway"}}';
}
@toofff
toofff / api_backends.conf
Created Sep 29, 2020 — forked from nginx-gists/api_backends.conf
Deploying NGINX Plus as an API Gateway, Part 1
View api_backends.conf
upstream warehouse_inventory {
zone inventory_service 64k;
server 10.0.0.1:80;
server 10.0.0.2:80;
server 10.0.0.3:80;
}
upstream warehouse_pricing {
zone pricing_service 64k;
server 10.0.0.7:80;
@toofff
toofff / api_backends.conf
Created Sep 29, 2020 — forked from nginx-gists/api_backends.conf
Deploying NGINX Plus as an API Gateway, Part 1
View api_backends.conf
upstream warehouse_inventory {
zone inventory_service 64k;
server 10.0.0.1:80;
server 10.0.0.2:80;
server 10.0.0.3:80;
}
upstream warehouse_pricing {
zone pricing_service 64k;
server 10.0.0.7:80;
View MySql-5.5-installation guide.md

MySQL Download URL

https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz

Open the terminal and follow along:

  • Uninstall any existing version of MySQL
sudo rm /var/lib/mysql/ -R
@toofff
toofff / API-Platform-2.6-admin-login.md
Created Feb 17, 2021 — forked from GregoireHebert/API-Platform-2.6-admin-login.md
How to create a login experience from the admin with API Platform 2.6
View API-Platform-2.6-admin-login.md

Creating a login experience from the Admin with API Platform 2.6

You can use whatever authentication mode you want, but for the sake of the demonstration let's use JWT.

I'll grab a freshly downloaded api-platform distribution.

from the php container :

	composer require jwt-auth
	apk add openssl
@toofff
toofff / .gitconfig
Created May 3, 2021
Git Configuration
View .gitconfig
[user]
name = My Name
email = my@email.com
[color]
ui = true
[core]
editor = nano
excludesfile = /home/user/.gitignore_global
[filter "lfs"]
clean = git-lfs clean %f