Like PHP's htmlentities()/htmlspecialchars() functions, JavaScript is easy to implement it.
/**
Like PHP's htmlentities()/htmlspecialchars() functions, JavaScript is easy to implement it.
/**
import React, { Suspense, useState } from "react"; | |
import { unstable_createResource as createResource } from "react-cache"; | |
import { | |
Combobox, | |
ComboboxInput, | |
ComboboxList, | |
ComboboxOption | |
} from "./Combobox2.js"; | |
function App({ tabIndex, navigate }) { |
let UserContext = React.createContext(); | |
class App extends React.Component { | |
state = { | |
user: null, | |
setUser: user => { | |
this.setState({ user }); | |
} | |
}; |
// | |
// Figma project stats | |
// Pulls statistics like number of files, frames, versions etc for a project. | |
// | |
// Usage: | |
// export FIGMA_API_ACCESS_TOKEN='your-token' | |
// node figma-project-stats.js <project-id> | |
// | |
// You can generate tokens in your account settings or at | |
// https://www.figma.com/developers/explorer#personal-access-token |
// handy method to create a Higher Order Component out of a | |
// Render Prop Component (like a Context.Consumer). | |
// handles, statics, displayName, refs, and value forwarding | |
function createHOCFromRenderProp({prop, Consumer}) { | |
return Component => { | |
function Wrapper(props, ref) { | |
return ( | |
<Consumer> | |
{value => <Component {...{...props, [prop]: value, ref}} />} |
// @flow | |
import * as React from "react"; | |
import ResizeObserver from "resize-observer-polyfill"; | |
import invariant from "invariant"; | |
type Entry = { | |
+contentRect: { | |
+width: number, | |
+height: number |
// @flow | |
import * as React from "react"; | |
import getStyleProp from "desandro-get-style-property"; | |
const supportsObjectFit = !!getStyleProp("objectFit"); | |
type Props = React.ElementProps<"img">; | |
export default class Image extends React.Component<Props> { |
Type crontab -l
to see your cron jobs. Type crontab -e
to edit them. You have to use Vim apparently.
Add a line like this:
0,30 * * * * /Users/YOURNAME/Documents/scripts/stretch.sh
That is on every 0th and 30th minute of the hour. Make sure all the separators in there are tabs!
# Global variables | |
re='^[0-9]+$' | |
# Will create a new branch with name ($1) from master | |
# it will also make sure master is up to date from origin | |
workstart() { | |
if ! [[ $1 =~ $re ]] | |
then | |
val=$1 | |
else |
import React from 'react' | |
import { func, node, number, object, shape, string } from 'prop-types' | |
import { withRouter } from 'react-router' | |
import debounceFn from 'lodash/debounce' | |
class ScrollManager extends React.Component { | |
static propTypes = { | |
children: node.isRequired, | |
history: shape({ | |
action: string.isRequired, |