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 useQueryString from './useQueryString' | |
export const Component = () => { | |
const [cat, setCat] = useQueryString<string>({ | |
key: 'cat', | |
defaultValue: 'Robert Paulson', | |
}); | |
return <h1>His name is <strong>{cat}</strong></h1> |
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 { GraphQLClient } from 'graphql-request'; | |
import { gqlSerializer } from './serializer.ts' | |
const gqlClient = new GraphQLClient(url, { | |
credentials: 'include', | |
mode: 'cors', | |
jsonSerializer: gqlSerializer, | |
}); |
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
# TODO: THIS FILE MIGHT HAVE TO GO TO OWN FOLDER database/main.tf | |
variable "security_group_ids" { | |
description = "Ids of VPC Security groups" | |
type = list(string) | |
} | |
variable "database_password" { | |
description = "Enter a new root SQL password. This variable is ignored if the DB is already set up." | |
type = string |
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
/** | |
* Usage node generate-story.js [path] | |
* | |
* Example (generate stories for all components in folder "components": | |
* node generate-story.js ./src/components | |
*/ | |
const fs = require('fs'); | |
const SUPPORTED_FILE_EXT = ['tsx', 'jsx']; | |
const EXCLUDED_FILES = []; |
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
# This file is your Lambda function | |
import json | |
import boto3 | |
def save_to_bucket(event, context): | |
AWS_BUCKET_NAME = 'my-bucket-name' | |
s3 = boto3.resource('s3') | |
bucket = s3.Bucket(AWS_BUCKET_NAME) | |
path = 'my-path-name.txt' |
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 { useCallback } from 'react'; | |
export function useCsvDownload( | |
data: Record<string, any>[], | |
title = 'data.csv', | |
) { | |
return useCallback(() => { | |
const headerKeys = data | |
.map((d) => Object.keys(d)) | |
.reduce((a, b) => { |
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
<html> | |
<form action="https://google.com/search" method="get"> | |
<input type="hidden" name="utm_source" /> | |
<input type="hidden" name="utm_medium" /> | |
<input type="hidden" name="utm_campaign" /> | |
<input type="hidden" name="utm_term" /> | |
<input type="hidden" name="utm_content" /> | |
<input type="submit" value="I pretend to be link" /> | |
</form> | |
<script> |
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
type ApplicationLog = { | |
level: 'debug' | 'info' | 'warning' | 'danger' | 'critical', | |
message: string, | |
createdAt: number, | |
userId?: string, | |
// a business metric, e.g. SIGNUP | |
action?: string, | |
monetaryValue?: number, | |
requestId?: string, |
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
# This file is your Lambda function | |
import base64 | |
import json | |
import boto3 | |
def save_to_bucket(event, context): | |
AWS_BUCKET_NAME = 'my-bucket-name' | |
s3 = boto3.resource('s3') |