Skip to content

Instantly share code, notes, and snippets.

@ayush
ayush / google-webfonts-categories.json
Created November 16, 2012 10:02
Google Webfonts Category Mapping
{
"Handwriting": [
"Calligraffitti",
"Coming Soon",
"Crafty Girls",
"Homemade Apple",
"Just Another Hand",
"Montez",
"Permanent Marker",
"Rancho",
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@mixin for-phone-only {
@media (max-width: 599px) { @content; }
}
@mixin for-tablet-portrait-up {
@media (min-width: 600px) { @content; }
}
@mixin for-tablet-landscape-up {
@media (min-width: 900px) { @content; }
}
@mixin for-desktop-up {
@dabit3
dabit3 / Router.vue
Last active December 4, 2023 21:36
Using AWS Amplify Vue with routing
const router = new Router({
routes: [
{
path: '/',
name: 'Home',
component: Home,
meta: { requiresAuth: true}
},
{
path: '/notes',
@loilo
loilo / ResponsiveContainer.md
Last active October 19, 2021 19:48
A Container-Query-like Responsive Container in Vue.js

Vue Responsive Container

A container component reacting to breakpoints on its own width or height, powered by ResizeObserver and scoped slots.

It is similar to things like vue-resize in that you can use it to observe a component's size. However the ResponsiveContainer will not emit any events, its whole point is to work as declaratively as possible, taking a predefined set of breakpoints you can access in your component.

Basic Usage

@tappleby
tappleby / server.ts
Created April 8, 2023 02:06
Sample remix handler based on remix-architect that supports AWS Lambda Streaming - https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/
import { createRequestHandler } from "./streaming-lambda.ts";
import * as build from "@remix-run/dev/server-build";
export const handler = awslambda.streamifyResponse(
createRequestHandler({
build,
mode: process.env.NODE_ENV,
})
);