Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| // Update globs depending on your framework | |
| --- | |
| name: tailwind_v4 | |
| description: Guide for using Tailwind CSS v4 instead of v3.x | |
| globs: ["**/*.{js,ts,jsx,tsx,mdx,css}"] | |
| tags: | |
| - tailwind | |
| - css | |
| --- |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.
| // OOP | |
| console.log( 'OHAI'.blink() ); | |
| // Call invocation | |
| console.log( String.prototype.blink.call('OHAI') ); | |
| // $ always makes things look awesome. | |
| var $ = Function.prototype.call; | |
| // Very explicit call invocation |
What was changed (compared to the original v0.1.2):
$.fn.swipe.options.swipe namespace) instead of DOM2 addEventListener to prevent errors in old IEs.swipeLeft and swipeRight functions to be called within the context of the bound element. Thanks, @kswedberg!| // from https://twitter.com/#!/LeaVerou/status/16613276313980929 | |
| // this pattern below is common for using an incoming value otherwise using some default. | |
| /* Bad: */ x = x ? x : y; // simple ternary. | |
| // if x is truthy lets use it. | |
| /* Better: */ x = x || y; // logical OR. | |
| // you could string a bunch of these easily to grab the first non-falsy value: |
This is now an actual repo:
| // 1: how could you rewrite the following to make it shorter? | |
| if (foo) { | |
| bar.doSomething(el); | |
| } else { | |
| bar.doSomethingElse(el); | |
| } | |