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
package main | |
import ( | |
"bytes" | |
"context" | |
"fmt" | |
"log" | |
"os" | |
"os/exec" |
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
/** | |
* Usage: | |
* After staging files with git, run this script to generate a commit message. | |
* Command: ts-node tools/message.ts | |
* This script analyzes the output of 'git diff --cached' to generate a meaningful commit message. | |
* It utilizes the OpenAI client to process the diff and suggests a concise summary. | |
*/ | |
import { config as dotenvConfig } from "dotenv"; | |
import { |
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
echo $(ifconfig | grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d: | head -n1) |
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 { | |
useCallback, | |
useEffect, | |
useMemo, | |
useReducer, | |
useRef, | |
useState, | |
} from "react"; | |
import { | |
QueryDocumentSnapshot, |
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 | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
# remove any existing directories and certificates | |
rm -rf $DIR/certs | |
# make directories to work from | |
mkdir -p $DIR/certs |
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
module.exports = function (file, api, options) { | |
if (file.source.indexOf("export default") < 0) { | |
// no need to process the file if no `export default` | |
return; | |
} | |
const j = api.jscodeshift; | |
const root = j(file.source); | |
const filePath = file.path; // replace `filePath` if you want to test different names |
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
type ComponentProps = { text: string } & React.HTMLAttributes<HTMLDivElement>; | |
type ComponentRef = HTMLDivElement; | |
const Component:React.FunctionComponent<ComponentProps> = React.forwardRef<ComponentRef, ComponentProps>( | |
({ text = 'default', className }, ref) => ( | |
<div className={className} ref={ref}> | |
{text} | |
</div> | |
), | |
); |
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
type ComponentProps = { text: string } & Pick<React.HTMLAttributes<HTMLDivElement>, 'className' | 'onClick'>; | |
const Component: React.FunctionComponent<ComponentProps> = ({ | |
text = 'default', | |
...props | |
}) => ( | |
<div className={className} {...props}> | |
{text} | |
</div> | |
); |
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 React from 'react'; | |
import styled, { StyledComponentBase } from 'styled-components'; | |
type ComponentProps = { text: string } & React.HTMLAttributes<HTMLDivElement>; | |
const Component: React.FunctionComponent<ComponentProps> = ({ | |
text = 'default', | |
className, | |
...props | |
}) => ( | |
<div className={className} {...props}> |
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 React from 'react'; | |
import { render } from 'testUtils'; | |
import { useQueryParam, useHistory } from './location'; | |
describe('location hooks', () => { | |
describe('useHistory', () => { | |
it('changes path without loosing query parameteras', () => { | |
const HookWrapper = () => { | |
const { push } = useHistory({ keepQuery: true }); | |
React.useEffect(() => { |
NewerOlder