Skip to content

Instantly share code, notes, and snippets.

@kokotom
kokotom / useStateOnlySearchParams.tsx
Created December 24, 2022 15:12
A hook for remix to read and update search params without causing navigation.
import {useCallback, useState} from 'react'
import {createSearchParams} from 'react-router-dom'
import {useLocation} from '@remix-run/react'
export type ParamKeyValuePair = [string, string]
type URLSearchParamsInit =
| string
| ParamKeyValuePair[]
| Record<string, string | string[]>
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
#!/bin/sh
CURRENT_DIRECTORY=$PWD
OUTPUT_DIRECTORY=patches/graphql
MAGENTO_DIRECTORY=$1
FROM_VERSION=$2
TO_VERSION=$3
mkdir -p $OUTPUT_DIRECTORY
@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active May 2, 2024 03:18
Front-end frameworks popularity (React, Vue, Angular and Svelte)
@lewisvoncken
lewisvoncken / url_path_flat_children_category.patch
Created February 14, 2018 12:42
url_path_flat_children_category
From 96be1ce725616f6282636db8630f08f6d068c1e0 Mon Sep 17 00:00:00 2001
From: Lewis Voncken <lewis@experius.nl>
Date: Wed, 16 Aug 2017 16:07:17 +0000
Subject: [PATCH] [BUGFIX] Flat Category reindexList of AllChildren if the
url_key of the current category has changed
---
vendor/magento/module-catalog/Model/Category.php | 3 +++
1 file changed, 3 insertions(+)
@adactio
adactio / minimal-serviceworker.js
Last active August 18, 2023 09:15
An attempt at a minimal viable service worker.
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
// HTML files: try the network first, then the cache.
// Other files: try the cache first, then the network.
// Both: cache a fresh version if possible.
// (beware: the cache will grow and grow; there's no cleanup)
const cacheName = 'files';

https://magentocommeng.slack.com

Generic Channels:

#general - community wide discussions
#announcements - all kind of announcements (new Magento 2 releases e.t.c.)
#random - non-magento related conversation/jokes/watercooling e.t.c.
#event -EVENTNAME - groups for given events such as contribution days, conferences e.t.c.
#events - generic channel for all event-based topics
#github - conversations around GitHub issues and Pull Requests

Special Project Channels:

Custom Functions and modules in Eve

Note: We plan to do a thorough documentation pass in the coming weeks to clean up and document the codebase. This document is a very rough draft intended to help intrepid adventurers navigate the jungle until then.

Terms Sheet

  • Cardinality - The number of results a thing would return.
  • Intermediate - A value which is necessary to derive the final result, but not part of the result.
  • Referential Transparency - The property of always returning exactly the same output given an input.
@axefrog
axefrog / router.js
Last active January 28, 2017 08:42
Simple router driver for Cycle.js utilising Router5 for routing functionality and adapting some of the code from VisionMedia's Page.js for automatic link click intercepting
'use strict';
import {Router5, RouteNode} from 'router5';
import logger from '../logger';
// The set of valid sink functions includes synchronous state-affecting router functions that do not require a callback
// and which do not have a significant return value other than the router object itself.
const validSinkFuncs = ['add','addNode','canActivate','deregisterComponent','navigate','registerComponent','setOption','start','stop'];
function validateAndRemapSinkArgument(arg) {
const EVENT = 'CHANGE';
function Engine() {
this._isInitialized = false;
Hull.init({ /* CREDENTIALS */ }, () => {
this._isInitialized = true;
this.emitChange();
};