Skip to content

Instantly share code, notes, and snippets.

Possible jQuery plugins

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):

Problem/Feature 1

YUI has a feature in Nodes and NodeLists with .get. It supports both:

@morganrallen
morganrallen / _README.md
Last active January 15, 2023 19:41
Janky Browser

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$> npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
@MotiurRahman
MotiurRahman / index.js
Created September 5, 2015 07:24
Date Picker using showDatePickerDialog() (Android only)
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');

Motivation

  • expression-oriented programming one of the great advances of FP
  • expressions plug together like legos, making more malleable programming experience in-the-small

Examples

Write in an expression-oriented style, scoping variables as locally as possible:

@jmoy
jmoy / thin-film.ipynb
Last active November 18, 2018 19:51
Why soap bubbles are colorful and windowpanes are not
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@freddi301
freddi301 / AsyncNode.tsx
Last active August 26, 2019 09:59
React component and hook for rendering promises
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<