Skip to content

Instantly share code, notes, and snippets.

View luandevpro's full-sized avatar

Luận Trần luandevpro

View GitHub Profile
import React, { useEffect, useState } from 'react';
import ApolloClient from 'apollo-client';
import { ApolloProvider } from 'react-apollo';
import { split } from 'apollo-link';
import { HttpLink } from 'apollo-link-http';
import { WebSocketLink } from 'apollo-link-ws';
import { getMainDefinition } from 'apollo-utilities';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { ApolloProvider as ApolloHooksProvider } from 'react-apollo-hooks';
import { setContext } from 'apollo-link-context';
minikube dashboard
@luandevpro
luandevpro / Post.js
Last active September 14, 2020 22:09
const mongoose = requier("mongoose")
const { ObjectId } = mongoose.Schema
const postSchema = new mongoose.Schema({
text: String,
image: String,
likes: [{type: ObjectId, ref: "user"}],
comments: [
{
text: String,
import Document, { Head, Main, NextScript } from 'next/document'
// Import styled components ServerStyleSheet
import { ServerStyleSheet } from 'styled-components';
import { getServerSideToken, getUserScript } from '../auth';
export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const sheet = new ServerStyleSheet();
const page = ctx.renderPage((App) => (props) =>
sheet.collectStyles(<App {...props} />),
name: "my hello action"
description: "say hello with GitHub Actions"
inputs:
firstGreeting:
description: "who would you like to greet in the console"
required: true
default: "Hubot"
name: "Docker Actions"
on: [push]
jobs:
action:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v1
name: "my hello action"
description: "say hello with GitHub Actions"
inputs:
firstGreeting:
description: "who would you like to greet in the console"
required: true
default: "Hubot"
package main
import (
"fmt"
"os"
)
func main() {
// Access Inputs as environment vars
name: Docker Actions
on: [push]
jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
FROM golang:latest
WORKDIR /go/src/hello
COPY . .
RUN go get -d -v ./...
RUN go install -v ./...
CMD ["hello"]