See also, http://libraryofalexandria.io/cgo/
cgo
has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src
. IDE's(vim) Goto command not works.
So, Here collect materials.
import { defineComponent, h, nextTick as vueNextTick } from "vue"; | |
import { mount } from "@vue/test-utils"; | |
import waitFor from 'p-wait-for'; | |
export interface RenderComposableResult<T> { | |
result: T; | |
waitFor: typeof waitFor, | |
nextTick: typeof vueNextTick; | |
} |
import * as z from 'zod' | |
import { defineEventHandler, CompatibilityEvent, useQuery } from 'h3' | |
const userSchema = z | |
.object({ | |
name: z.string().min(4, { message: 'Must be 4 or more characters long' }), | |
age: z.string().transform((age) => parseInt(age, 10)) | |
}) | |
type UnknownKeysParam = "passthrough" | "strict" | "strip"; |
// ~/server/middleware/proxy.ts | |
import { defineEventHandler } from 'h3' | |
import { createProxyMiddleware } from 'http-proxy-middleware'; // npm install http-proxy-middleware@beta | |
const apiProxyMiddleware = createProxyMiddleware({ | |
target: 'https://jsonplaceholder.typicode.com', | |
changeOrigin: true, | |
ws: true, | |
pathRewrite: { | |
'^/api/todos': '/todos', |
{ | |
"emojis": [ | |
{"emoji": "👩👩👧👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👩👩👧👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👩👩👦👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👨👩👧👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z |
See also, http://libraryofalexandria.io/cgo/
cgo
has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src
. IDE's(vim) Goto command not works.
So, Here collect materials.
<script setup lang="ts"> | |
import { io } from 'socket.io-client' | |
const connected = ref(false) | |
onMounted(() => { | |
const socket = io(); | |
socket.on('connect', () => { | |
connected.value = socket.connected |
import React, { PropsWithChildren, useEffect, useState } from 'react'; | |
import { Animated, Dimensions, Keyboard, KeyboardAvoidingView, StyleSheet, TextInput } from 'react-native'; | |
import {useHeaderHeight} from '@react-navigation/elements'; | |
import { useKeyboard } from '@react-native-community/hooks'; | |
export default function KeyboardShift (props: PropsWithChildren<{}>) { | |
const [shift, setShift] = useState(new Animated.Value(0)) | |
const keyboard = useKeyboard() | |
// On mount, add keyboard show and hide listeners |
// https://github.com/tannerlinsley/react-query/discussions/296#discussioncomment-1244793 | |
export const useRefetchOnFocus = (refetch = () => {}, canRefetch = true) => { | |
const [isScreenFocused, setIsScreenFocused] = useState(false); | |
useFocusEffect(() => { | |
setIsScreenFocused(true); // when i focus the screen | |
return () => setIsScreenFocused(false); // when i quit the screen | |
}); | |
/* the screen still always active in cache so we need to check that the screen is focused in a use effect | |
to dispatch the refetch only one time to avoid the infinity loop*/ |
<template> | |
<div> | |
<h1>Rick and Morty Characters</h1> | |
<button @click="refetch()" :disabled="isFetching">{{ isFetching ? 'Refetching...' : 'Refetch' }}</button> | |
<div v-if="isLoading">loading...</div> | |
<div v-else> | |
<ul> | |
<li v-for="char in characters" :key="char.id"> | |
{{ char.name }} - {{ char.status }} | |
</li> |
import Common, { Chain } from '@ethereumjs/common' | |
import { Transaction } from '@ethereumjs/tx' | |
import Web3 from 'web3' | |
const web3 = new Web3('https://ropsten.infura.io/v3/blablablabla') | |
const account1 = 'YOUR_ACCOUNT_1' | |
const privateKey1 = Buffer.from('YOUR_ACCOUNT_1_PRIVATE_KEY', 'hex') | |
const account2 = 'YOUR_ACCOUNT_2' |