This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import debounce from 'lodash.debounce'; | |
/** | |
* @example | |
* import { reactive, watch } from './reactivity'; | |
* | |
* const r1 = reactive({ isReady: false }) | |
* const r2 = reactive({ x: 1 }) | |
* | |
* setTimeout(() => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @example | |
* const item = watch({}, (value, prop, source) => { | |
* if (prop === 'foo' && !value) { | |
* return 'default_value'; | |
* } | |
* | |
* if (prop === 'baz') { | |
* return 'nope'; | |
* } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @example | |
*.try { | |
* const result = await retry((attempt) => { | |
* if ( Math.ceil(Math.random() >= .5) ) { | |
* return 'ok'; | |
* } | |
* | |
*. console.log('-> nope'); | |
* throw new Error('Failed after ' + attempt + ' tries'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEGIN MAINTENANCE MODE | |
# ADD your IP address to gain access. Local IPS for local testing | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REMOTE_ADDR} !^192\.168\.0\.0 | |
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1 | |
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f | |
RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f | |
RewriteCond %{SCRIPT_FILENAME} !maintenance.html | |
RewriteRule ^.*$ /maintenance.html [R=503,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('.wpml-translation-setup-table input[type="radio"][value="3"]').forEach(input => { input.checked = true; }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Path to the Git user file | |
GIT_USERS_FILE=~/.gitusers | |
# Check if Git is installed | |
if ! command -v git &>/dev/null; then | |
echo "Git is not installed on this machine" | |
exit | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |
OlderNewer