Skip to content

Instantly share code, notes, and snippets.

View AlexWang-16's full-sized avatar

Alex Wang AlexWang-16

View GitHub Profile
@AlexWang-16
AlexWang-16 / gist:75f39f24d3d78e0e1dc592895ab28d75
Created May 7, 2022 03:28
AWS Terraform Provider v4.13 aws_wafv2_web_acl geo-restriction rule bug
Error: Provider produced inconsistent final plan
│ When expanding the plan for module.amp_web_waf.aws_wafv2_web_acl.waf to include new values learned so far during apply, provider "registry.terraform.io/hashicorp/aws" produced an invalid new value for .rule:
│ planned set element
│ cty.ObjectVal(map[string]cty.Value{"action":cty.ListValEmpty(cty.Object(map[string]cty.Type{"allow":cty.List(cty.Object(map[string]cty.Type{"custom_request_handling":cty.List(cty.Object(map[string]cty.Type{"insert_header":cty.Set(cty.Object(map[string]cty.Type{"name":cty.String,
│ "value":cty.String}))}))})), "block":cty.List(cty.Object(map[string]cty.Type{"custom_response":cty.List(cty.Object(map[string]cty.Type{"custom_response_body_key":cty.String, "response_code":cty.Number,
│ "response_header":cty.Set(cty.Object(map[string]cty.Type{"name":cty.String, "value":cty.String}))}))})),
│ "count":cty.List(cty.Object(map[string]cty.Type{"custom_request_handling":cty.List(cty.Object(map[string]cty.Type{"insert_header":cty.Set(cty.Obj
// Copyright 2009 Alex Wang. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: |
The elements of the array are rearranged so as to reverse their order.
The object is returned as the result of the call
esid: sec-array.prototype.reverse
description: >
Check for length is 0, Array, elements are primitives and objects
@AlexWang-16
AlexWang-16 / .htaccess
Created August 30, 2017 15:59 — forked from Zodiac1978/.htaccess
Make your Website faster - a safe htaccess way
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
#
@AlexWang-16
AlexWang-16 / karabiner.json
Created October 7, 2016 22:15
Swap Caps Lock and Escape Key (Mac OS 10.12 Sierra - Karabiner Elements configuration)
{
"profiles": [
{
"name": "Default profile",
"selected": true,
"simple_modifications": {
"caps_lock": "escape",
"escape" : "caps_lock"
}
}
@AlexWang-16
AlexWang-16 / vimrc
Created February 25, 2016 23:45
Murdoc2k's vim configuration file
" VIMRC v0.5
set shell=/bin/bash
runtime macros/matchit.vim
" Vundle Plugin management system
set nocompatible
filetype off " Required
set rtp+=~/.vim/bundle/vundle/
@AlexWang-16
AlexWang-16 / tmux.conf
Last active February 25, 2016 23:41
Murdoc2k's tmux config
# The following code is optimized for 13" Macbooks
# tmux conf v0.5
# Enable 256 colors for tmux
set -g default-terminal "screen-256color"
set -g status-keys vi
# Sets Window base to 1 instead of 0
set -g base-index 1
set-window-option -g pane-base-index 1