Start postgreSQL
$ sudo systemctl start postgresql
function makeStore({ actions }) { | |
// Make a context for the store | |
const context = React.createContext(); | |
// Make a provider that takes an initialValue | |
const Provider = ({ initialValue = {}, children }) => { | |
// Make a new state instance | |
const [state, setState] = useState(initialValue); | |
// Bind the actions with the old state and args |
const useCancellable = fn => { | |
const requestRef = useRef(0) | |
return async (...args) => { | |
// Keep track of latest promise ID | |
const id = Date.now() | |
requestRef.current = id | |
// Wait for resolution | |
const res = await fn(...args) |
import { useCount, useIncrement, useDecrement } from './store.Count' | |
export default function Counter () { | |
const count = useCount() | |
const increment = useIncrement() | |
const decrement = useDecrement() | |
return ( | |
<div> | |
<div>Count: {count}</div> |
// Source | |
const MyCompSource = '' | |
// @source MyCompSource | |
const MyComp = ( | |
<div> | |
Hello there! | |
</div> | |
) |
license: gpl-3.0 |
/* Customize website's scrollbar like Mac OS | |
Not supports in Firefox and IE */ | |
/* total width */ | |
body::-webkit-scrollbar { | |
background-color: #fff; | |
width: 16px; | |
} | |
/* background of the scrollbar except button or resizer */ |
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> /* set the CSS */ | |
.bar { fill: steelblue; } | |
</style> | |
<body> | |
<!-- load the d3.js library --> |