Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
sindresorhus / esm-package.md
Last active April 1, 2025 11:17
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@kerryboyko
kerryboyko / README.md
Last active April 26, 2023 16:08
VueJS Best Practices Guide

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

@gdomiciano
gdomiciano / .gitlab-ci.yml
Last active December 20, 2018 17:57
GitLab CI configuration for Nuxt.js Deployment
# Passos que o seu Servidor de CI deverá seguir (test/build/deploy)
stages:
- deploy
# nome da tarefa do CI
deploy_prod:
# Passo a que esta tarefa pertence
stage: deploy
# definição de comandos necessários para essa tarefa
script:
@slavafomin
slavafomin / git-submodules.md
Last active February 19, 2025 03:15
Git submodules best practices

Git submodules best practices

Useful commands

— Clone repository with submodules automatically:

git clone --recursive [email protected]:name/repo.git

— Initialize submodules after regular cloning:

@yehudah
yehudah / remove-password-enforce.php
Created February 26, 2017 19:34
Remove password enforce from password reset page after register
<?php
/*
Plugin Name: Remove Pass enforce
Version: 1.0
Author: Yehuda Hassine
License: GPL2
*/
add_action('login_enqueue_scripts', 'remove_pass_enforce', 11 );
function remove_pass_enforce() {
<alignment jcr:primaryType="nt:unstructured"
name="./alignChildren"
fieldLabel="Alignment of components"
required="{Boolean}true"
selectionMode="single"
sling:resourceType="granite/ui/components/coral/foundation/form/buttongroup">
<items jcr:primaryType="nt:unstructured">
<default jcr:primaryType="nt:unstructured"
name="./default"
@israelcrux
israelcrux / save-and-restore-contenteditable-selection.js
Last active January 14, 2024 13:58
Save and Restore DOM text selection
function saveSelection() {
if (window.getSelection) {
var sel = window.getSelection();
if (sel.getRangeAt && sel.rangeCount) {
return sel.getRangeAt(0);
}
} else if (document.selection && document.selection.createRange) {
return document.selection.createRange();
}
return null;
@nateyolles
nateyolles / .content.xml
Created July 13, 2016 05:15
AEM using Granite Render Conditions
<items jcr:primaryType="nt:unstructured">
<widgetAlways
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
fieldLabel="This always shows"
name="./widgetAlways"/>
<widgetHeaderChrome
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
fieldLabel="This only shows when header &quot;User-Agent&quot; contains &quot;chrome&quot;"
@nateyolles
nateyolles / aemTouchCheckboxDialog.xml
Last active April 12, 2023 03:00
AEM Touch UI component dialog checkboxes
<!-- Checked checkbox will result in a String property of "true" -->
<myCheckbox
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/checkbox"
text="My Checkbox"
name="./myCheckbox"
value="true"/>
<!-- Checked checkbox will result in a Boolean property of true-->
<myBooleanCheckbox
@glen-cheney
glen-cheney / encoding-video.md
Last active November 24, 2024 10:09
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus