This file contains 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
/* | |
* Copyright 2020 Adobe. All rights reserved. | |
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. You may obtain a copy | |
* of the License at http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software distributed under | |
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | |
* OF ANY KIND, either express or implied. See the License for the specific language | |
* governing permissions and limitations under the License. |
This file contains 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
/** | |
* Return a copy of an object, but with values of a key replaced with value of provided key-value object. | |
* Useful for duplicating highly nested object, but generating new values for a key (e.g. `id`) | |
* | |
* | |
* @param obj An object | |
* @param keyToReplace The key of the values needed to be swapped | |
* @param mapOfOldToNewValues A key-value object with a keys of old values mapped to new ones (used for swapping) | |
* | |
* @example |
This file contains 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 { globalHistory, navigate, RedirectProps, History } from '@reach/router'; | |
import React from 'react'; | |
type ReachHistory = History & { | |
_onTransitionComplete: () => void; | |
}; | |
/** | |
* Why is `SuspenseRedirect` necessary when @reach/router has `Redirect`? | |
* |
This file contains 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
package org.formium.util; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.StringJoiner; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class SearchUtil { | |
public static Map<String,String> parseSearchQuery(String query) { |
This file contains 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
package org.formium.util; | |
import com.google.i18n.phonenumbers.NumberParseException; | |
import com.google.i18n.phonenumbers.PhoneNumberUtil; | |
import com.google.i18n.phonenumbers.Phonenumber; | |
import java.util.Optional; | |
public class ValidateUtil { | |
public static Optional<String> validatePhone(String phone) { |
This file contains 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 { useRef, useCallback, useEffect } from 'react' | |
import { useInView } from 'react-intersection-observer' | |
import 'intersection-observer' | |
export default ({ src, caption, ratio }) => { | |
const [inViewRef, inView] = useInView({ | |
threshold: 1, | |
}) | |
const videoRef = useRef() |
This file contains 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
diff --git a/node_modules/react-scripts/config/webpack.config.js b/node_modules/react-scripts/config/webpack.config.js | |
index 25840d9..25c3c41 100644 | |
--- a/node_modules/react-scripts/config/webpack.config.js | |
+++ b/node_modules/react-scripts/config/webpack.config.js | |
@@ -172,7 +172,7 @@ module.exports = function(webpackEnv) { | |
// The build folder. | |
path: isEnvProduction ? paths.appBuild : undefined, | |
// Add /* filename */ comments to generated require()s in the output. | |
- pathinfo: isEnvDevelopment, | |
+ pathinfo: false, |
This file contains 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
1) Create a branch with the tag | |
git branch {tagname}-branch {tagname} | |
git checkout {tagname}-branch | |
2) Include the fix manually if it's just a change .... | |
git add . | |
git ci -m "Fix included" | |
or cherry-pick the commit, whatever is easier | |
git cherry-pick {num_commit} | |
This file contains 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
# Take a screenshot every n seconds | |
# Fun for making timelapse gifs later | |
# run `creep 20` for every 20 seconds | |
function creep() { | |
while :; do; echo "📸" $(date +%H:%M:%S); screencapture -x ~/Screenshots/wes/$(date +%s).png; sleep $1; done | |
} | |
alias db="cd ~/Dropbox/" | |
alias zs="source ~/.zshrc" | |
alias gum="git pull upstream master" |
This file contains 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 * as React from 'react'; | |
/** | |
* React.Ref uses the readonly type `React.RefObject` instead of | |
* `React.MutableRefObject`, We pretty much always assume ref objects are | |
* mutable (at least when we create them), so this type is a workaround so some | |
* of the weird mechanics of using refs with TS. | |
*/ | |
export type AssignableRef<ValueType> = | |
| { |