Skip to content

Instantly share code, notes, and snippets.

View chunkydotdev's full-sized avatar
🍦
Thinking of icecream

Magnus Junghard chunkydotdev

🍦
Thinking of icecream
View GitHub Profile
@chunkydotdev
chunkydotdev / Component1.tsx
Last active March 14, 2022 19:23
A component that uses some theme variables from ThemeProvider
import styled from 'styled-components'
const PrimaryButton = styled.button`
background-color: ${({theme}) => theme.colors.primary};
border: 0;
margin-bottom: ${({theme}) => theme.spacings.md};
`
const Component1 = () => {
@chunkydotdev
chunkydotdev / theme.ts
Created March 14, 2022 16:21
Open theme structure
export const Spacings = {
xs: '4px',
sm: '8px',
md: '16px',
lg: '32px',
xl: '64px'
}
export const colors = {
primary: '#00A6FB',
@chunkydotdev
chunkydotdev / Component1.tsx
Last active March 14, 2022 19:23
styled components using the open structured theme
import styled from 'styled-components'
import { Colors, Spacings } from '../theme.ts'
const PrimaryButton = styled.button`
background-color: ${Colors.primary};
border: 0;
margin-bottom: ${Spacings.md};
`
const Component1 = () => {
@chunkydotdev
chunkydotdev / gitpolljob.sh
Created March 17, 2023 12:17
Polls the local git-repository for changes and updates if any are found
cd /home/dev/bunny-game-api
[ $(git rev-parse HEAD) = $(git ls-remote $(git rev-parse --abbrev-ref @{u} | \
sed 's/\// /g') | cut -f1) ] && echo up to date || (git pull && docker compose up -d --build api database)