Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Mrcode Mrcooder

🏠
Working from home
Block or report user

Report or block Mrcooder

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View *tracked.md

tracked npm

@tracked is a decorator for Preact that makes working with state values no different than properties on your component instance.

It's one 300 byte function that creates a getter/setter alias into state/setState() for a given key, with an optional initial value. The "magic" here is simply that it works as a property decorator rather than a function, so it appears to integrate directly into the language.

tracked has no dependencies and works with any component implementation that uses this.state and this.setState().

Installation

View react_samples_list.md
View gist:981817
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@jehiah
jehiah / simple_args_parsing.sh
Created Mar 4, 2011
a simple way to parse shell script arguments
View simple_args_parsing.sh
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
You can’t perform that action at this time.