Skip to content

Instantly share code, notes, and snippets.

Avatar

Trần Văn Luận luandevpro

View GitHub Profile
View Post.js
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,
View _document.js
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} />),
View action.yml
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"
View my-workflow.yml
name: "Docker Actions"
on: [push]
jobs:
action:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v1
View my-workflow.yml
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"
View main.go
package main
import (
"fmt"
"os"
)
func main() {
// Access Inputs as environment vars
View my-workflow.yml
name: Docker Actions
on: [push]
jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
View Dockerfile
FROM golang:latest
WORKDIR /go/src/hello
COPY . .
RUN go get -d -v ./...
RUN go install -v ./...
CMD ["hello"]
View main.go
package main
import "fmt"
func main() {
fmt.Println("Hello Docker Actions")
}
You can’t perform that action at this time.