Skip to content

Instantly share code, notes, and snippets.

@steveruizok
steveruizok / sponsors.ts
Created November 19, 2021 13:38
A Next.js API route that will generate an image of your most recent 100 Github sponsors.
// pages/api/sponsors.ts
import { NextApiRequest, NextApiResponse } from 'next'
const AV_SIZE = 32
const PADDING = 4
const COLS = 16
type SponsorResult = { avatarUrl: string; login: string }
@malarkey
malarkey / alt-styles.css
Last active October 28, 2023 19:42
A simpler approach to CSS styling using just one default style plus one alternative.
/* CSS Custom Properties */
:root {
--font-family-default: 'Merriweather', serif;
--font-family-alt: 'Merriweather Sans', sans-serif;
--font-color-default: #b1a18;
--font-color-alt: #f5f5f3;
--font-link-default: #a62339;
@joshuat
joshuat / Slack avatar-less sidebar.md
Last active January 19, 2021 08:25
Remove the avatars from your slack sidebar

Slack has listened to feedback and given us a way to toggle off the sidebar avatars.

(This only seems to be available in the Beta channel at the moment)

Display or hide profile photos

  1. From your desktop, click your profile picture in the top right.
  2. Select Preferences from the menu.
  3. Click Sidebar in the left-side column.
  4. Check or uncheck the boxes next to Show profile photos next to DMs.
@christiannaths
christiannaths / package.json
Created July 3, 2017 20:00
SVG file to JSX Component Script
"scripts": {
"build": "yarn icons:crush && yarn icons:to-jsx && yarn diagrams:crush && yarn diagrams:to-jsx",
"icons:crush": "svgo --pretty --indent=2 -f ./icons/assets",
"icons:to-jsx": "babel-node --presets=react,es2015 ./scripts/svg-to-jsx.js ./icons/assets ./icons",
"diagrams:crush": "svgo --pretty --indent=2 -f ./diagrams/assets",
"diagrams:to-jsx": "babel-node --presets=react,es2015 ./scripts/svg-to-jsx.js ./diagrams/assets ./diagrams"
}
@bendc
bendc / easing.css
Created September 23, 2016 04:12
Easing CSS variables
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@chales
chales / sed cheatsheet
Last active January 3, 2023 13:57 — forked from un33k/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@ericandrewlewis
ericandrewlewis / gist:95239573dc97c0e86714
Last active December 12, 2023 09:52
Setting up a WordPress site on AWS

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

@bobbygrace
bobbygrace / trello-css-guide.md
Last active April 22, 2024 10:15
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?