- expression-oriented programming one of the great advances of FP
- expressions plug together like legos, making more malleable programming experience in-the-small
Write in an expression-oriented style, scoping variables as locally as possible:
| export function AsyncNode({ children }: { children: Promise<ReactNode> }) { | |
| return useLatestResolvedValue<ReactNode>(children, () => null) as any; | |
| // as any assertion needed for issue https://github.com/DefinitelyTyped/DefinitelyTyped/issues/20356#issuecomment-336384210 | |
| } | |
| export function useLatestResolvedValue<Value>( | |
| promise: Promise<Value>, | |
| initial: () => Value | |
| ) { | |
| const [[value], dispatch] = useReducer< |
| var picker = Ti.UI.createPicker({ | |
| type : Ti.UI.PICKER_TYPE_DATE, | |
| top : 50 | |
| }); | |
| $.txt.addEventListener('click', function(e) { | |
| picker.showDatePickerDialog({ | |
| callback : function(e) { | |
| if (e.cancel) { | |
| Ti.API.info('User canceled dialog'); |
I'm contemplating two new jQuery plugins, but wanted some feedback, both on the implementation, as well as if it's worth doing.
Here are the two pieces of functionality/problems I'm hoping to address (and they're somewhat related):
YUI has a feature in Nodes and NodeLists with .get. It supports both:
| var jsObject = { | |
| foo: 'bar' | |
| }; | |
| var tiObject = Ti.UI.create2DMatrix(); | |
| function isJsObject(obj) { | |
| return typeof obj.__proto__ !== 'undefined'; | |
| } |
| /** | |
| * VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units | |
| * | |
| * To overcome this, create media queries that target the width, height, and orientation of iOS devices. | |
| * It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing | |
| * the height of element `.foo` —which is a full width and height cover image. | |
| * | |
| * iOS Resolution Quick Reference: http://www.iosres.com/ | |
| */ | |
| <img src="http://img.shields.io/badge/Operator_overload-guilty-red.svg" height="20" alt="Uses operator overloads"/> |
| # The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
| # | |
| # Current known FCC address ranges: | |
| # https://news.ycombinator.com/item?id=7716915 | |
| # | |
| # Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
| # | |
| # In your nginx.conf: | |
| location / { |