Skip to content

Instantly share code, notes, and snippets.

@Sorbog
Sorbog / magento2.dev-vhost.conf
Last active June 12, 2023 13:54
Magento 2 Apache Virtual Host Configuration
<VirtualHost *:80>
ServerName magento2.dev
SetEnv MAGE_RUN_CODE "base"
SetEnv MAGE_RUN_TYPE "website"
DocumentRoot "/var/www/html/magento2.dev/pub"
<Directory "/var/www/html/magento2.dev/pub">
AllowOverride All
Order Allow,Deny
@IlyaZha
IlyaZha / Install_WebStorm.sh
Last active October 2, 2018 16:05 — forked from almirb/Install_Phpstorm.sh
Update webstorm on Ubuntu linux.
#!/bin/bash -e
# Original credits to theodorosploumis
# IMPORTANT. My webstorm installation exists on /opt/webstorm.
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root."
exit 1
fi
@hailwood
hailwood / helpers.php
Last active December 4, 2022 23:30
HMR sass support for laravel mix
<?php
if (!function_exists('isHMR')) {
/**
* Get whether HMR is active.
*
* @return bool
*/
function isHMR()
{
@almirb
almirb / Install_Phpstorm.sh
Last active January 29, 2018 17:06 — forked from theodorosploumis/Install_Phpstorm.sh
Update phpstorm on Ubuntu linux.
#!/bin/bash -e
# Original credits to theodorosploumis
# IMPORTANT. My phpstom installation exists on /opt/phpstorm.
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root."
exit 1
fi
@IlyaZha
IlyaZha / gist:a72ea944f1fb7daebbee9bbcefb97399
Last active December 13, 2016 12:00 — forked from drakakisgeo/gist:3bba2a2600b4c554f836
Auto trim all input [Laravel 5]
// Step 1. Create this class in the middleware folder (/app/Http/Middleware).
<?php
namespace App\Http\Middleware;
use Closure;
class BeforeAutoTrimmer {
@ggregoire
ggregoire / README.md
Created October 13, 2016 20:35
React: stopPropagation VS nativeEvent.stopImmediatePropagation

TL;DR

If you mix JS event listeners and React event listeners, you need

event.nativeEvent.stopImmediatePropagation()

Scenario

@fradee
fradee / setup_mailcatcher.sh
Last active March 9, 2017 08:07 — forked from shark0der/setup_mailcatcher.sh
Mailcatcher installation script for Ubuntu 16.04 (14.04 commands commented out)
#!/bin/bash
# Install dependencies
# older ubuntus
#apt-get install build-essential libsqlite3-dev ruby1.9.1-dev
# xenial
apt install build-essential libsqlite3-dev ruby-dev
# Install the gem
# gem install mime-types -v 2.6.2 (gem install mime-types --version "< 3" gem install --conservative mailcatcher)
@branneman
branneman / count-lint-errors.js
Last active July 31, 2023 17:59
Group-By-Count ESLint errors
// :: (String, String) => String
const spawn = require('child_process').spawnSync;
// :: String => [String]
const getRules = raw => raw
.split('\n')
.map(line => line.trim())
.filter(line => !!line)
.filter(line => line[0] !== '/' && line[0] !== '✖')
.map(line => line.match(/[a-z-]+$/)[0]);
@odan
odan / xampp_php7_xdebug.md
Last active April 17, 2024 05:36
Installing Xdebug for XAMPP
@drakakisgeo
drakakisgeo / gist:3bba2a2600b4c554f836
Created May 7, 2015 13:51
Auto trim all input [Laravel 5]
// Step 1. Create this class in the middleware folder.
<?php namespace App\Http\Middleware;
use Closure;
class BeforeAutoTrimmer {
/**
* Handle an incoming request.