This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { parse as parseAst } from "acorn"; | |
import { load as parseYaml } from "js-yaml"; | |
import { parse as parseToml } from "toml"; | |
// stolen from remcohaszing/remark-mdx-frontmatter | |
const getValue = (node) => { | |
const { type, value } = node; | |
if (type === "yaml") { | |
return load(value); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// manually generate token for a given page (for when data is available in local) | |
generateTokenForPage(page: number): string { | |
return btoa(JSON.stringify({ skip: page * this.recordsPerPage, limit: this.recordsPerPage })); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AB1, AC4, AD10, BE3, CD4, CF2, DE1, EB3, EA2, FD1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
how to use: | |
1. preview this page with: http://htmlpreview.github.io/ | |
2. drag the link in your bookmarks bar | |
3. visit the page https://gitlab.com/xxxx/-/settings/ci_cd | |
4. click on the bookmarklet. | |
--> | |
<!DOCTYPE html> | |
<html lang="en"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RoutingRules> | |
<RoutingRule> | |
<Condition> | |
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals> | |
</Condition> | |
<Redirect> | |
<HostName>myhostname.com</HostName> | |
<ReplaceKeyPrefixWith>#!/</ReplaceKeyPrefixWith> | |
</Redirect> | |
</RoutingRule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
post: { | |
postId: 'postId', | |
data: { | |
images: [{ | |
postId: 'childPost', | |
fileId: 'imageId', | |
}] | |
}, | |
parentId: 'parentId', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BadGoose = () => (<div>shown!</div>) | |
const App = (props) => { | |
const [toggle, setToggle] = useState(true) | |
return (<div> | |
<button onClick={() => setToggle(!toggle)}>click me</div> | |
{ toggle ? <BadGoose /> : null } | |
</div>) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BadGoose = ({ show }) => (show ? <div>shown!</div> : null) | |
const App = (props) => { | |
const [toggle, setToggle] = useState(true) | |
return (<div> | |
<button onClick={() => setToggle(!toggle)}>click me</div> | |
<BadGoose show={toggle} /> | |
</div>) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import { isTouchEnable } from '../es6/functions.js'; | |
/** Display autocomplete component on searches */ | |
var Autocomplete = function(settings) { | |
this.settings = { | |
element: settings.element, | |
} | |
this.init(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState } from 'react' | |
export default (prop, value = null, context = {}) => { | |
const [val, setVal] = useState(value) | |
Object.defineProperty(context, prop, { | |
get() { return val }, | |
set(val) { setVal(val) }, | |
}) | |
NewerOlder