$ docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { user } from './store.js' | |
user.set(window__SK__USER__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
import { defineComponent, toRaw } from 'vue' | |
import { | |
QueryObserver, | |
type QueryKey, | |
type QueryObserverResult, | |
type QueryClient, | |
} from '@tanstack/query-core' | |
type Todo = { | |
userId: number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AllowedComponentProps, Component, defineComponent, VNodeProps } from 'vue' | |
export type ExtractComponentProps<TComponent> = | |
TComponent extends new () => { | |
$props: infer P; | |
} | |
? Omit<P, keyof VNodeProps | keyof AllowedComponentProps> | |
: never; | |
const TestComponent = defineComponent({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Ultra lightweight Github REST Client */ | |
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
const token = 'github-token-here' | |
const githubClient = generateAPI('https://api.github.com', { | |
headers: { | |
'User-Agent': 'xyz', | |
'Authorization': `bearer ${token}` | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ~/server/middleware/express.ts | |
import express from 'express' | |
import todoRoutes from '~/server/express/todo' | |
import userRoutes from '~/server/express/user' | |
const app = express() | |
app.use('/api/todos', todoRoutes) | |
app.use('/api/users', userRoutes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.94 Chrome/37.0.2062.94 Safari/537.36 | |
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36 | |
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko | |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0 | |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/8.0.8 Safari/600.8.9 | |
Mozilla/5.0 (iPad; CPU OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H321 Safari/600.1.4 | |
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36 | |
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36 | |
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240 | |
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const admin = require('firebase-admin'); | |
function buildHtmlWithPost (post) { | |
const title = post.title + ' | Example Website'; | |
var head = { | |
title: title, | |
meta: [ | |
// This may not be a valid combination of tags for the services you need to support; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const util = require('util'); | |
const exec = util.promisify(require('child_process').exec); | |
async function deployOnlyChangedFunctions() { | |
const { stdout: shaOfLostCommit } = await exec('git rev-parse HEAD'); | |
const { stdout: changedFiles } = await exec(`git log -m -1 --name-only --pretty="format:" ${shaOfLostCommit}`); | |
const functionsFolder = 'functions/modules/' | |
const filenames = changedFiles.split('\n') | |
.filter((line) => line.startsWith(functionsFolder)) | |
.map((line) => line.split('/')[2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { | |
AsyncData, | |
KeyOfRes, | |
PickFrom, | |
_Transform, | |
} from 'nuxt/dist/app/composables/asyncData' | |
import type { AsyncDataOptions, NuxtApp } from '#app' | |
export default async function useAsyncDataWithError< | |
DataT, |
NewerOlder