Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jaydson Gomes jaydson

🏠
Working from home
View GitHub Profile
View pg14.sql
--PostgreSQL 13
SELECT *
FROM shirts
WHERE details->'attributes'->>'color' = 'neon yellow'
AND details->'attributes'->>'size' = 'medium';
--PostgreSQL 14
SELECT *
FROM shirts
WHERE details['attributes']['color'] = '"neon yellow"'
View how-we-built-a-publisher-platform-with-next-js-graphql-and-vercel-3.js
export async function getStaticPaths() {
return {
paths: [
{ params: { ... } } // See the "paths" section below
],
fallback: true or false // See the "fallback" section below
};
}
View how-we-built-a-publisher-platform-with-next-js-graphql-and-vercel-2.js
export async function getStaticProps(context) {
return {
props: {}, // will be passed to the page component as props
}
}
View how-we-built-a-publisher-platform-with-next-js-graphql-and-vercel-1.js
export async function getServerSideProps(context) {
return {
props: {}, // will be passed to the page component as props
}
}
View css-json.css
-- {
--: {
"css": true,
"totally": {
"not": "controversial!"
}
}
}
#cool {
View gist:ba1e0146c1f5c21dc04424b6338d8d79
# create the project
mkdir my-app
cd my-app
npm init svelte@next
# install dependencies
npm install
# start dev server and open a browser tab
npm run dev -- --open
View custom-input-10.js
<!-- CustomInput.vue -->
<template>
<label>
{{ label }}
<input type="text" :name="name" :value="value" @input="onInput" @change="onChange" />
</label>
</template>
<script>
export default {
View custom-input-9.js
<!-- CustomInput.vue -->
<template>
<label>
{{ label }}
<input type="text" :name="name" v-model="model" />
</label>
</template>
<script>
export default {
View custom-input-8.js
<!-- CustomInput.vue -->
<template>
...
<input type="text" :name="name" v-model="model" />
...
</template>
<script>
...
computed: {
View custom-input-7.js
<!-- CustomInput.vue -->
...
<script>
...
watch: {
value: {
handler(value) {
if (value) {
this.error = '';
}