Skip to content

Instantly share code, notes, and snippets.

View MikhailRoot's full-sized avatar

Mikhail MikhailRoot

View GitHub Profile
@simpixelated
simpixelated / build-non-split.js
Last active March 9, 2021 11:26
Disable Code Splitting (and caching) In Create React App
const rewire = require('rewire');
const defaults = rewire('react-scripts/scripts/build.js');
let config = defaults.__get__('config');
config.optimization.splitChunks = {
cacheGroups: {
default: false,
},
};
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active April 24, 2024 12:46
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

<?php
/*
This script will allow you to send a custom email from anywhere within wordpress
but using the woocommerce template so that your emails look the same.
Created by craig@123marbella.com on 27th of July 2017
Put the script below into a function or anywhere you want to send a custom email
*/
@nonbeing
nonbeing / git-deployment.md
Last active April 2, 2024 14:24 — forked from noelboss/git-deployment.md
Simple deployment using git's post-receive hook

Also see: https://gist.github.com/lemiorhan/8912188

Simple automated deployment using git hooks

Here are the simple steps needed to push your local git repository directly to a remote (e.g. prod) server over ssh. This is based on Digital Ocean's Tutorial.

Overview

You are developing in a working-directory on your local machine, let's say on the master branch. Usually people push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use GitHub's webhooks to send a POST request to a webserver to take appropriate actions such as cloning/checking out a branch on the remote (prod) server.

@garrettmac
garrettmac / custom.filter.buttons.tags.liquid
Last active March 15, 2023 00:10
Shopify Filter Snippets
Tag Filter:
<ul class="subnav clearfix">
<li{% unless current_tags %} class="active"{% endunless %}>
{% if collection.handle %}
<a href="/collections/{{ collection.handle }}{% if collection.sort_by %}?sort_by={{ collection.sort_by }}{% endif %}">All</a>
{% elsif collection.current_type %}
<a href="{{ collection.current_type | url_for_type | sort_by: collection.sort_by }}">All</a>
@AndrewHenderson
AndrewHenderson / build.js
Last active December 1, 2022 00:06
Rollup, Gulp, and Babel (ES6)
// Gulp
import gulp from 'gulp';
import plumber from 'gulp-plumber';
import file from 'gulp-file';
import filter from 'gulp-filter';
import rename from 'gulp-rename';
import sourcemaps from 'gulp-sourcemaps';
import uglify from 'gulp-uglify';
// Rollup
import { rollup } from 'rollup';
@dnordby
dnordby / shopify-loadmore.md
Last active December 29, 2021 18:03
Shopify <li> loadmore (products)

Use Shopify pagination to trigger loadmore event

Markup

{% paginate collection.products by 16 %}
<div class="products__collection">
  <ul class="product collection__grid"">
    {% for product in collection.products %}
      {% assign prod_id = forloop.index | plus:paginate.current_offset %}
      {% include 'product-grid-item' with prod_id %}
@noelboss
noelboss / git-deployment.md
Last active April 25, 2024 10:38
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@beaucharman
beaucharman / debounce.js
Last active February 25, 2022 20:35
An ES6 implementation of the debounce function. "Debouncing enforces that a function not be called again until a certain amount of time has passed without it being called. As in 'execute this function only if 100 milliseconds have passed without it being called.'" - CSS-Tricks (https://css-tricks.com/the-difference-between-throttling-and-debounc…
function debounce(callback, wait, immediate = false) {
let timeout = null
return function() {
const callNow = immediate && !timeout
const next = () => callback.apply(this, arguments)
clearTimeout(timeout)
timeout = setTimeout(next, wait)
@c9s
c9s / .babelrc
Last active October 21, 2023 14:04
webpack + babel + typescript + es6 - total solutions!
{
"presets": ["es2015"],
"plugins": ["transform-runtime"]
}