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
<div class="bg-green"> | |
<div class="container mx-auto"> | |
<ul class="md:flex list-reset"> | |
<li class="hover:bg-grey p-4"><a href="#">Link 1</a></li> | |
<li class="hover:bg-grey p-4"><a href="#">Link 2</a></li> | |
<li class="hover:bg-grey p-4"><a href="#">Link 3</a></li> | |
<li class="hover:bg-grey p-4"><a href="#">Link 4</a></li> | |
<li class="hover:bg-grey p-4"><a href="#">Link 5</a></li> | |
</ul> | |
</div> |
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
<div class="inline-flex w-full justify-center"> | |
<ul> | |
<li>5</li> | |
<li>4</li> | |
<li>3</li> | |
<li>2</li> | |
<li>1</li> | |
</ul> | |
</div> |
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
// Working example | |
// https://codesandbox.io/s/lr5zjxrn67 | |
// Method #1 | |
function replaceAt(string, indexArray) { | |
let newString = [...string]; | |
for (let i = 0; i < indexArray.length; i++) { | |
newString = Object.assign(newString, { | |
[indexArray[i]]: <b>{newString[indexArray[i]]}</b> |
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
package main | |
import "fmt" | |
//Listener is a | |
type Listener struct { | |
ID int | |
} | |
//ListenerInterface is an |
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
export const useGrpcRequest = (func, setState) => { | |
const [params, setParams] = useState(null); | |
useEffect(() => { | |
let unmounted = false; | |
(async () => { | |
try { | |
if (!params) return; | |
const result = await func(params); | |
if (unmounted) return; |
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
// https://play.golang.org/p/5p28UL4thc_r | |
package main | |
import "fmt" | |
func main() { | |
s := InitializeServices() // Inject *sql.DB here | |
s.CreateAuthor(0, "name", "[email protected]") // Example http/grpc/graphql endpoints |
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 ( | |
stmtCreateUser = iota | |
stmtGetUser | |
stmtUpdateUser | |
) | |
var stmtPairs = []struct { | |
id int | |
stmt 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
import React, { useEffect, useState, useRef, useReducer } from "react"; | |
import { Link } from "react-router-dom"; | |
export const Test = () => { | |
const [input, setInput] = useState("world"); | |
const [data, refetch] = useGrpcRequest(myRequest, { name: "init" }, []); | |
// useEffect(() => console.clear(), []); | |
const handleOnClick = () => { |
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
WDIR := /go/src/github.com/Pisush/tensorflow-and-go | |
DIR := ${CURDIR}:${WDIR} | |
DOCKER_IMAGE := dahernan/tensorflow-and-go | |
login: | |
docker run -i -v $(DIR) -w $(WDIR) --entrypoint=/bin/bash -t $(DOCKER_IMAGE) | |
dockerbuild: | |
docker build -f Dockerfile -t $(DOCKER_IMAGE) . |
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 'package:architecture_playground/home_page.dart'; | |
import 'package:architecture_playground/services.dart'; | |
import 'package:flutter/material.dart'; | |
void main() async { | |
// perform long-running tasks before "runApp" to display the native splash screen | |
final services = await Services.initialize(); | |
runApp(ServicesProvider( | |
services: services, |
OlderNewer