Experimental hooks-based bindings for Unistore. Available on npm:
npm i unistore-hooks
Note: this should also work with React, just alias
"preact"and"preact/hooks"to"react"in your bundler.
| #!/usr/bin/env bash | |
| set -Eeuo pipefail | |
| trap cleanup SIGINT SIGTERM ERR EXIT | |
| script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
| usage() { | |
| cat <<EOF | |
| Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
| // [dependencies] | |
| // tokio = { version = "0.2", features = ["macros"] } | |
| // warp = "0.2.2" | |
| use warp::Filter; | |
| use warp::http::HeaderMap; | |
| use std::convert::Infallible; | |
| #[tokio::main] | |
| async fn main() { |
| // tests/nexus-test-environment.js | |
| const NodeEnvironment = require('jest-environment-node') | |
| const { nanoid } = require('nanoid') | |
| const util = require('util') | |
| const exec = util.promisify(require('child_process').exec) | |
| const fs = require('fs') | |
| const path = require('path') | |
| const prismaBinary = './node_modules/.bin/prisma' |
Experimental hooks-based bindings for Unistore. Available on npm:
npm i unistore-hooks
Note: this should also work with React, just alias
"preact"and"preact/hooks"to"react"in your bundler.
| call plug#begin(expand('~/.vim/plugged')) | |
| Plug 'arcticicestudio/nord-vim' | |
| Plug 'sheerun/vim-polyglot' | |
| call plug#end() | |
| filetype indent plugin on | |
| colorscheme nord | |
| syntax on | |
| set autoindent | |
| set backspace=2 | |
| set cursorline |
| # TODO: replace :token, :user, and :repo | |
| curl -H "Authorization: token :token" \ | |
| -H 'Accept: application/vnd.github.everest-preview+json' \ | |
| "https://api.github.com/repos/:user/:repo/dispatches" \ | |
| -d '{"event_type": "awesomeness", "client_payload": {"foo": "bar"}}' |
| import React, { Component } from 'react'; | |
| import { render, hydrate } from 'react-dom'; | |
| import { PDFDownloadLink } from '@react-pdf/renderer'; | |
| import { ModelCertificate } from './ModelCertificate'; | |
| export default class PDFLink extends Component { | |
| state = { | |
| loading: false, | |
| }; |
| /* Helper buddy for removing async/await try/catch litter 🗑 */ | |
| function O_o(promise) { | |
| return promise.then(data => { | |
| if (data instanceof Error) return [data] | |
| return [null, data] | |
| }).catch(err => [err]) | |
| } | |
| /* Look ma, no try/catch */ | |
| async function usageExample(params) { |
| FROM adminer:4.7.1 | |
| # WATCH OUT WHEN UPGRADING, THE SED BELOW MIGHT STOP WORKING | |
| MAINTAINER [email protected] | |
| USER root | |
| RUN apk add autoconf gcc g++ make libffi-dev openssl-dev | |
| RUN pecl install mongodb | |
| RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/docker-php-ext-mongodb.ini |