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 com.fasterxml.jackson.annotation.JsonProperty | |
import com.squareup.moshi.JsonAdapter | |
import com.squareup.moshi.JsonClass | |
import com.squareup.moshi.JsonReader | |
import com.squareup.moshi.JsonWriter | |
import com.squareup.moshi.Moshi | |
import com.squareup.moshi.Types | |
import com.squareup.moshi.internal.Util | |
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory |
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 com.fasterxml.jackson.annotation.JsonTypeInfo | |
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper | |
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME) | |
sealed class Principal | |
object AnonymousUser : Principal() { | |
val _empty: String? = null | |
} | |
// other implementations of Principal |
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
# Create react-app with typescript | |
yarn create react-app react-graphql-ts --template typescript | |
cd react-graphql-ts | |
mkdir -p src/graphql | |
cp ../graphql/*.graphql src/graphql | |
# Deps | |
yarn add @material-ui/core \ | |
@material-ui/icons \ |
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
{ | |
"navn": "Arnab", | |
"antall": 3 | |
} |
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 kotlinx.coroutines.delay | |
import kotlinx.coroutines.flow.flow | |
import java.time.Duration | |
suspend fun <T: Any>tickerFlow( | |
period: Duration, | |
initialDelay: Duration = Duration.ZERO, | |
func: () -> T | |
) = flow<T> { | |
while (true) { |
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
# xcode tools (required) | |
# xcode-select --install | |
# Install zsh (required for homebrew) | |
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
# install homebrew | |
# (highly recommended: makes everything below easier) | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" |
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
name: CI | |
on: [push] | |
jobs: | |
build: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: install | |
uses: borales/actions-yarn@v2.0.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
import React from 'react' | |
import { PropTypes } from 'prop-types' | |
import { Query } from 'react-apollo' | |
import gql from 'graphql-tag' | |
const Speaker = ({match}) => { | |
Speaker.Proptypes = { | |
match: PropTypes.shape({ | |
params: PropTypes.shape({ | |
id: PropTypes.String |
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
mutation{ | |
speaker: createSpeaker(data: { | |
name: "Name" | |
email: "example@example.com" | |
workplace_url: "some_workplace_url" | |
}){ | |
id | |
} | |
talkOne: createTalk(data: { |
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 express = require('express') | |
const graphqlHTTP = require('express-graphql') | |
import schema from './schema' | |
// The root provides a resolver function for each API endpoint | |
const root = { | |
hello: () => 'World' | |
} | |
const app = express() |
NewerOlder