Skip to content

Instantly share code, notes, and snippets.

View albingroen's full-sized avatar

Albin Groen albingroen

View GitHub Profile
@albingroen
albingroen / use-query-param.ts
Last active August 16, 2022 18:55
useQueryParam
export default function useQueryParam<T>(
key: string,
push: (path: string) => void,
defaultValue?: T,
): [T, (value: T) => void] {
const { pathname, search } = location
const query = new URLSearchParams(search)
const rawValue = query.get(key)
@albingroen
albingroen / tailwind.config.js
Last active June 21, 2021 09:55
Tailwind CSS Typography | Github markdown theme
module.exports = {
purge: ["./pages/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}"],
darkMode: "media", // or 'media' or 'class'
mode: "jit",
theme: {
extend: {
typography: (theme) => ({
light: {
css: {
color: "#adbac7",
@albingroen
albingroen / delete-github-repos.js
Last active June 4, 2021 15:22
Delete multiple GitHub repos from your profile
#!/usr/bin/env node
const axios = require("axios");
// ADD THE NAME OF THE REPOS YOU WANT TO DELETE HERE
const repos = [];
// ADD YOUR GITHUB USERNAME HERE
const username = ""
<AnimateSharedLayout>
<motion.div layout>
<AnimatePresence>
{todos.map((todo) => (
<motion.div
initial={{ opacity: 0, x: -50 }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: 50 }}
key={todo.id}
layout
# Your Spotify account name.
username = YOUR_SPOTIFY_USERNAME
# Your Spotify account password.
password = YOUR_SPOTIFY_PASSWORD
# How this machine shows up in Spotify Connect.
device_name = spotifyd
device_type = computer
@albingroen
albingroen / cypress.yml
Created June 26, 2020 16:27
Cypress yaml file
name: Cypress
on: [push]
jobs:
cypress-run:
runs-on: ubuntu-16.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Cypress run
uses: cypress-io/github-action@v2
// Add all pages you want to test
module.exports = [
{
path: '/',
name: 'Start',
actions: [
{
event: 'type',
element: '#mainInput',
const envs = {
// Required environments
local: "URL TO YOUR LOCAL ENVIRONMENT",
live: "URL TO YOUR LIVE ENVIRONMENT",
// Any environment you want. For example:
dev: "URL TO YOUR DEV ENVIRONMENT",
staging: "URL TO YOUR STAGING ENVIRONMENT",
}
// Add all pages you want to test
module.exports = [
{
path: '/',
name: 'Start'
}
]