Skip to content

Instantly share code, notes, and snippets.

View PaulieScanlon's full-sized avatar

Paul Scanlon PaulieScanlon

View GitHub Profile
@PaulieScanlon
PaulieScanlon / index.js
Created June 26, 2024 13:32
Example of Linaria generated CSS Modules import
import styles from './SomeComponent.module.css';
const SomeComponent = () => {
return (
<a className={styles.ButtonLink}>
styled link
</a>
);
}
@PaulieScanlon
PaulieScanlon / module.css
Created June 26, 2024 13:31
Example Linaria generated CSS Modules
/* src/components/some-component/SomeComponent.module.css */
.ButtonLink {
background: transparent;
border-radius: 3px;
border: 1px solid var(--accent-color);
color: var(--accent-color);
display: inline-block;
margin: 0.5rem 1rem;
padding: 0.5rem 0px;
@PaulieScanlon
PaulieScanlon / index.js
Created June 26, 2024 13:29
Example React component with Linaria
// src/components/some-component/index.js
import styled from '@linaria/react';
const SomeComponent = () => {
return (
<ButtonLink>
styled link
</ButtonLink>
);
@PaulieScanlon
PaulieScanlon / index.css
Created June 26, 2024 13:26
Example styled-components generated class
.hcJJXU {
background: transparent;
border-radius: 3px;
border: 1px solid var(--accent-color);
color: var(--accent-color);
display: inline-block;
margin: 0.5rem 1rem;
padding: 0.5rem 0px;
transition: all 200ms ease-in-out 0s;
width: 11rem;
@PaulieScanlon
PaulieScanlon / index.js
Created June 26, 2024 13:25
Example React component with styled-components
// src/components/some-component/index.js
import styled from 'styled-components';
const SomeComponent = () => {
return (
<ButtonLink>
styled link
</ButtonLink>
);
@PaulieScanlon
PaulieScanlon / index.js
Created June 26, 2024 13:24
Example styled-components class name
<html>
<body>
<a class="sc-4c0ad8fd-0 hcJJXU">
styled link
</a>
</body>
</html>
@PaulieScanlon
PaulieScanlon / .env
Last active June 21, 2024 20:47
Include double quotes with env var
GOOGLE_APPLICATION_CREDENTIALS_BASE64="abc123"
@PaulieScanlon
PaulieScanlon / .shell
Created June 20, 2024 14:58
Convert Google Application credentials to base64
cat name-of-creds-file.json | base64
@PaulieScanlon
PaulieScanlon / index.js
Created June 20, 2024 14:41
Slack Message request
// src/index.js#L59
body: JSON.stringify({
blocks: [
{
type: 'header',
text: {
type: 'plain_text',
text: '📊 7 Days Google Analytics Report',
emoji: true,
@PaulieScanlon
PaulieScanlon / index.js
Created June 20, 2024 14:40
Report markdown string
// src/index.js#L42
const report = response.rows
.map((row, index) => {
const { dimensionValues, metricValues } = row;
return `${index + 1}. <https://${dimensionValues[0].value}|${dimensionValues[1].value}> | *x${
metricValues[0].value
}*`;
})