Skip to content

Instantly share code, notes, and snippets.

@lowmess
lowmess / Stack.tsx
Created Apr 27, 2021
Theme UI Stack with dividers
View Stack.tsx
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 Sep 18, 2020
iTerm2 Plastic Theme
View Plastic.itermcolors
<?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>
View lastfm-album-ranking.js
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 Nov 17, 2017
Convert boolean and integer strings to literals
View convert-string.js
// 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;
}
@lowmess
lowmess / external-links.js
Created Oct 28, 2016
functions for manipulating external-facing links
View external-links.js
View array-prototype-fizzbuzz.js
// @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 Apr 2, 2016
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.
View full-height-footer.js
@lowmess
lowmess / .gitignore
Last active Jun 2, 2016
Default Metalsmith build
View .gitignore
node_modules
_build
@lowmess
lowmess / index.html
Last active Apr 2, 2016 — forked from 1forh/index.html
Prevent map zoom on scroll (without jQuery)
View index.html
<div id="map__wrapper">
<iframe id="map__canvas"></iframe>
</div>