Skip to content

Instantly share code, notes, and snippets.

View jgierer12's full-sized avatar

Jonas Gierer jgierer12

View GitHub Profile

Syntax

All target selectors start with @. The following character is the selector type. For example, @p means 'closest player'.

Target selectors may have additional, optional arguments. You can specify these in [ ], using the syntax argument=value. For example, @p[x=0,y=5,z=-500].

There is a special short syntax for just specifying x, y, z and r arguments; simply list their values separated by a comma, without x=. For example: @p[100,64,-100,5] for 5 range, x=100, y=64 and z=-100. Each of these are optional and skippable by leaving them empty. For example, to just specify y coordinate: @p[,64].

Global Arguments:

| Argument | Function | Default | Restrictions | Notes

# Anywhere in your filter as long as it is not inside a function. Should be on the same column as "displayName"
VERSION = "<Filter Version. Checked against the Update Page's version>"
UPDATE_URL = "<URL that points to the filters update page. This should be in the Page Format above>"
WIP_URL = "<!!Optional!! URL that points to the filters Work In Progress update page. This should be in the Page Format above. When the 'Include WIP versions' option is set to true or this version is a WIP and the specified URL leads to a valid filter updates page, the update filter will always use this URL instead!>"
WIP = "<'True' if this is a Work In Progress version, otherwise 'False'>"
# Rest of filter
[core]
autocrlf = false
editor = subl --wait --new-window
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
[url "https://github.com/"]
root = true
[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[{package.json,*.yml}]
export default arr => arr.some(x => arr.includes(-x));
const gcd = (x, y) => y ? gcd(y, x % y) : x;
const simplify = xs => xs.map(x => x / gcd(...xs));
export default str => simplify(str.split(' ')).join(' ');
let clicked = false;
// `mousedown` always seems to fire before `focusin`.
// (But within the same millisecond).
document.addEventListener('mousedown', () => {
clicked = true;
setTimeout(() => clicked = false, 1);
});
// `focusin` is the bubbling version of `focus`.
const View = ({ loading, error, ...otherProps }) => (
<div>
{(() => {
if (loading) {
return <Loading />
} else if (error) {
return <Error error={error} />
} else {
return <MyLoadedComponent {...otherProps} />
};
.mtki {
/* Enable Cartograph Mono CF font features */
font-feature-settings: 'ss01' on;
}
@jgierer12
jgierer12 / codepan.json
Created January 27, 2018 12:06
Try it online! codepan.net/gist/ca0f1001fa2a0920f892fa754e600653
{
"showPans": [
"js",
"output"
],
"activePan": "js"
}