Skip to content

Instantly share code, notes, and snippets.

View tanhauhau's full-sized avatar

Tan Li Hau tanhauhau

View GitHub Profile
@swyxio
swyxio / types for estree with JSX.ts
Last active August 7, 2020 01:56
types for estree with JSX - the default estree types (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/estree/index.d.ts) dont come with JSX definitions so i made a short start on them. pls comment if you have more to add
interface Location {
start: number;
end: number;
};
interface JSXOpeningElement extends Location {
type: 'JSXOpeningElement',
attributes: JSXAttribute[],
name: JSXIdentifier,
selfClosing: boolean
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@dherman
dherman / template-literals.md
Last active July 4, 2021 10:41
What can you do with ES6 string template literals?

DOM selectors

var elements = query`.${className}`;

Localization

var message = l10n`Hello ${name}; you are visitor number ${visitor}:n!
@asabaylus
asabaylus / gist:3071099
Created July 8, 2012 14:12
Github Markdown Heading Anchors

Anchors in Markdown

To create an anchor to a heading in github flavored markdown. Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:

[create an anchor](#anchors-in-markdown)