Skip to content

Instantly share code, notes, and snippets.

@nderscore
nderscore / TamaguiZeego.tsx
Last active October 26, 2024 00:06
Example of how to wrap Zeego's components with Tamagui styles
import { FC } from 'react';
/**
* Utilities to make Typescript happy wrapping Zeego components with Tamagui's
* styled() components. These utils do nothing except assign Typescript types.
*
* Makes the following props optional and of `unknown` type:
* - children
* - key
*
@itsderek23
itsderek23 / scout_apm_absinthe_plug.ex
Last active March 4, 2020 06:58
Scout Absinthe (GraphQL) Instrumentation
defmodule ScoutApm.Absinthe.Plug do
alias ScoutApm.Internal.Layer
def init(default), do: default
def call(conn, _default) do
ScoutApm.TrackedRequest.start_layer("Controller", action_name(conn))
conn
|> Plug.Conn.register_before_send(&before_send/1)
@kawanet
kawanet / material-colors.json
Last active October 13, 2024 05:42
Material Design Style Color Palette as JSON
{
"red": {
"50": "#ffebee",
"100": "#ffcdd2",
"200": "#ef9a9a",
"300": "#e57373",
"400": "#ef5350",
"500": "#f44336",
"600": "#e53935",
"700": "#d32f2f",
class InsetTextField < UITextField
attr :edgeInsets
def init
initWithFrame(CGRectZero)
end
def initWithFrame(frame)
super.tap do
@edgeInsets = [0, 0, 0, 0]

Usability Checklist

User Experience

  • Personalized features. Currency, language, country specific deals, taxes, or delivery options are changed based on user's location.
  • Registering provides value to users. For example a "Free Trial" button communicates a clear benefit, but a "Register" button doesn't. Unnecessary registration is avoided.
  • Transparent pricing. Prices are clearly displayed. There are no hidden costs or surprises in the terms.
  • Pages don't refresh automatically. Users can get confused if new content is uploaded suddenly, for example on news websites.
  • Sample content. For example there is a sample newsletter next to a newsletter sign up form.
@bensie
bensie / base.rb
Created December 6, 2012 17:53
Sinatra API Helpers
require "sinatra/base"
require "sinatra/namespace"
require "multi_json"
require "api/authentication"
require "api/error_handling"
require "api/pagination"
module Api
class Base < ::Sinatra::Base
@joshsmith
joshsmith / gist:1932988
Created February 28, 2012 15:06
CSS code conventions

CSS code conventions

Block style

selector {
    property: value;
}
  • Each selector is on its own line.