Skip to content

Instantly share code, notes, and snippets.

@lowmess
lowmess / about-page.js
Created July 26, 2021 03:09
lameass.recipes schema
export default {
title: 'About Page',
name: 'about_page',
type: 'document',
fields: [
{
title: 'Title',
name: 'title',
type: 'string',
},
@lowmess
lowmess / Stack.tsx
Created April 27, 2021 19:44
Theme UI Stack with dividers
import * as React from 'react'
import { Box, Flex } from 'theme-ui'
import { ResponsiveStyleValue } from '@theme-ui/css'
import { BoxProps } from '@theme-ui/components'
interface Props extends BoxProps {
gap?: ResponsiveStyleValue<number>
dividers?: boolean
dividerColor?: ResponsiveStyleValue<string>
}
@lowmess
lowmess / Plastic.itermcolors
Created September 18, 2020 04:09
iTerm2 Plastic Theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.16862745583057404</real>
const secrets = {
LASTFM_KEY: '',
LASTFM_USER: '',
}
let albums = []
fetch(
`https://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&user=${
secrets.LASTFM_USER
@lowmess
lowmess / convert-string.js
Last active November 17, 2017 17:34
Convert boolean and integer strings to literals
// Convert boolean and integer strings to literals
// convertString("true") => true
// convertString("12") => 12
// convertString("string") => "string"
function convertString(str) {
try {
JSON.parse(str);
} catch {
return str;
}
{
"path": "cz-conventional-changelog"
}
@lowmess
lowmess / external-links.js
Created October 28, 2016 21:05
functions for manipulating external-facing links
// @link http://codepen.io/lowmess/pen/JXvNVp?editors=0011
// this is a bad idea.
Array.prototype.fizzbuzz = function () {
for (var i = 1; i <= this.length; i++) {
var fizzBuzzString = ''
if (i % 3 === 0) fizzBuzzString = 'Fizz'
if (i % 5 === 0) fizzBuzzString += 'Buzz'
@lowmess
lowmess / full-height-footer.js
Last active April 2, 2016 01:31
Quick fix for ensuring that the footer always reaches the bottom of a given window. Note that this extends the footer, it doesn't move it.
@lowmess
lowmess / .gitignore
Last active June 2, 2016 00:22
Default Metalsmith build
node_modules
_build