Smallest possible CSS-in-JS library.
- Try demo
- 178 bytes (minified and gzipped)
- Source code fits in a tweet
- Dynamic 4th generation styling
- "jsxstyle" interface
- Pure React — no side effects
// Create a queue to push events and stub all methods | |
window.analytics || (window.analytics = {}); | |
window.analytics_queue || (window.analytics_queue = []); | |
(function() { | |
var methods = ['identify', 'track', 'trackLink', 'trackForm', 'trackClick', 'trackSubmit', 'page', 'pageview', 'ab', 'alias', 'ready', 'group', 'on', 'once', 'off']; | |
var factory = function(method) { | |
return function () { | |
var args = Array.prototype.slice.call(arguments); | |
args.unshift(method); |
Smallest possible CSS-in-JS library.
html { box-sizing: border-box } | |
*, *:before, *:after { box-sizing: inherit; } | |
body { margin: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } | |
body, h1, h2, h3, h4, h5, h6, p, ol, ul { | |
margin: 0; | |
padding: 0; | |
font-weight: normal; | |
} |
import React, { Component } from "react"; | |
import get from "utils/get"; | |
// Use extend ContainerBase in your Route Containers and use | |
// the provided lifecycle hooks to load data. This way you'll | |
// have a predictable edge to know when data is loaded for your | |
// Route - super useful for serverside rendering your app! | |
class ContainerBase extends Component { | |
state = { |
#!/usr/bin/env python | |
''' | |
Simple and functional REST server for Python (3.5) using no dependencies beyond the Python standard library. | |
Ported from original lib for Python 2.7 by Liron (tliron @ github.com) https://gist.github.com/tliron/8e9757180506f25e46d9 | |
Features: | |
* Map URI patterns using regular expressions | |
* Map any/all the HTTP VERBS (GET, PUT, DELETE, POST) | |
* All responses and payloads are converted to/from JSON for you | |
* Easily serve static files: a URI can be mapped to a file, in which case just GET is supported |
"use strict"; | |
[foo,bar] = TNG(foo,bar); | |
// NOTE: intentionally not TNG(..) wrapping useBaz(), so that it's | |
// basically like a "custom hook" that can be called only from other | |
// TNG-wrapped functions | |
function foo(origX,origY) { | |
var [x,setX] = useState(origX); | |
var [y,setY] = useState(origY); |
#!/bin/bash | |
# Generate a `:something-intensifies:` Slack emoji, given a reasonable image | |
# input. I recommend grabbing an emoji from https://emojipedia.org/ | |
set -euo pipefail | |
# Number of frames of shaking | |
count=10 | |
# Max pixels to move while shaking |
/* Get 12 most recent instagram thumbnails from a public account | |
* resolution = 0 - 4 | |
* 0 => 150 | |
* 1 => 240 | |
* 2 => 320 | |
* 3 => 480 | |
* 4 => 640 | |
*/ | |
export default function(username, resolution = 4) { | |
return fetch(`https://www.instagram.com/${username}/?__a=1`) |
Companies building interesting things. No specific order.