Skip to content

Instantly share code, notes, and snippets.

View Jexordexan's full-sized avatar
:shipit:
lgtm

A Jordan Simonds Jexordexan

:shipit:
lgtm
View GitHub Profile
@Jexordexan
Jexordexan / contact.vue
Last active January 1, 2018 21:26
A basic form for netilfy
<template>
<div class="container">
<h1 class="title">
Contact
</h1>
<div class="content">
<form name="contact" action="" method="post">
<label class="form-label" for="name">
Name:
</label>
@Jexordexan
Jexordexan / contact.vue
Last active October 3, 2021 14:59
Final contact page template code
<template>
<div class="container">
<h1 class="title">
Contact
</h1>
<div class="content">
<form name="contact" action="/thank-you" netlify-honeypot="bot-field" method="post" netlify>
<input type="hidden" name="form-name" value="contact" />
<p class="hidden">
<label>Don’t fill this out: <input name="bot-field"></label>

Keybase proof

I hereby claim:

  • I am jexordexan on github.
  • I am jexordexan (https://keybase.io/jexordexan) on keybase.
  • I have a public key ASBIFqSYrwWSZleLjSqJGb4QvdhDxku58_fZj4YXv-jdewo

To claim this, I am signing this object:

type PropType = String | Boolean | Number | Object | typeof Array
function prop<T = any>(type: PropType, options: any = {}): T {
return { type, ...options } as any
}
@Jexordexan
Jexordexan / prop-function.ts
Created August 6, 2019 21:34
Medium: Prop function
type PropType = String | Boolean | Number | Object | typeof Array
function prop<T = any>(type: PropType, options: any = {}): T {
return { type, ...options } as any
}
@Jexordexan
Jexordexan / props-option-1.ts
Created August 6, 2019 21:35
Medium: props option 1
interface Props {
user: api.User
alerts: api.Alert[]
}
export default createComponent({
name: "UserAlerts",
props: {
user: Object,
alerts: Array,
export default createComponent({
name: "UserAlerts",
props: {
user: Object as any as User,
alerts: Array as any as Alert[],
},
setup(props) {
// Typescript infers typeof 'props' to be:
// {
// user: User,
import { prop } from 'ts-tricks-hidey-hole'
export default createComponent({
name: "UserAlerts",
props: {
user: prop<User>(Object),
alerts: prop<Alert[]>(Array),
},
setup(props) {
// Typescript infers typeof 'props' to be:
interface Props {
user: api.User
alerts?: api.Alert[]
}
import { value, createComponent } from 'vue-function-api'
export default createComponent({
props: /* ... */,
setup(props) {
const sort = state({
field: 'created_at',
reverse: false,
})