Skip to content

Instantly share code, notes, and snippets.

@carolineschnapp
carolineschnapp / currencies.liquid
Last active May 2, 2024 15:47
currencies.liquid
{% if settings.show_multiple_currencies %}
{{ "//cdn.shopify.com/s/javascripts/currencies.js" | script_tag }}
{{ "jquery.currencies.min.js" | asset_url | script_tag }}
<script>
Currency.format = '{{ settings.currency_format | default: 'money_with_currency_format' }}';
var shopCurrency = '{{ shop.currency }}';
@theodorosploumis
theodorosploumis / Install_Phpstorm.sh
Last active June 16, 2022 11:15
Update phpstorm on Ubuntu linux.
#!/bin/bash -e
# IMPORTANT. My phpstom installation exists on /opt/phpstorm.
# Early Access program: https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program
# For stable releases try: https://data.services.jetbrains.com/products/download?code=PS&platform=linux
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root."
exit 1
fi
@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.
@odan
odan / xampp_php7_xdebug.md
Last active May 29, 2024 13:56
Installing Xdebug for XAMPP
@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]);
@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)
@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

@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 {
@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
@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()
{