This file contains hidden or 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 ollama | |
from pydantic import BaseModel, Field | |
from typing import Literal, List | |
# Define a more descriptive JSON structure using Pydantic. | |
class UserInfo(BaseModel): | |
name: str = Field(description="The full name of the user who wrote the text.") | |
sentiment: Literal["positive", "neutral", "negative"] = Field( | |
description="The overall sentiment of the text." | |
) |
This file contains hidden or 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
ThemeData( | |
appBarTheme: AppBarTheme( | |
backgroundColor: Colors.white, | |
centerTitle: true, | |
titleTextStyle: TextStyle( | |
fontSize: 18, | |
color: Colors.black, | |
), | |
), | |
// ... |
This file contains hidden or 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
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
theme: ThemeData( //... ), |
This file contains hidden or 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
dev: | |
make serve & | |
watch -n 1 make build doc | |
doc: init | |
esdoc -c etc/esdoc_conf.json | |
build: init | |
rollup -c etc/rollup_conf.js | |
cp dist/yip.js docs/demo/ |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="material.indigo-pink.min.css"> | |
</head> | |
<body> |
This file contains hidden or 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 appState = { | |
'message': 'hello' | |
} | |
// Register the component. | |
vue.component('my-awesome-component', { | |
template: '#myAwesomeComponent', | |
data: appState | |
}); |
This file contains hidden or 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
<html> | |
<template id="myAwesomeComponent"> | |
<h1>I am awesome</h1> | |
<p>You are awesome too.</p> | |
<p>{{ message }}</p> | |
</template> | |
<div id="myAwesomePage"> | |
<my-awesome-component></my-awesome-component> |
This file contains hidden or 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
<article> | |
<meta name="title" content="my codelab" /> | |
<meta name="description" content="something about my codelab"> | |
<section title="Getting started"> | |
My markdown *in* here. | |
</section> |
This file contains hidden or 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 a connection | |
pubsub = Connection(PROJECT, credentials) | |
# Quick intro | |
# 1. publisher | |
topic = pubsub.create_topic('my-topic') | |
for i in range(100): | |
topic.publish('msg-{}'.format(i)) |
This file contains hidden or 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
class Connection(object): | |
#... | |
def get_operation(self, operation, zone=None): | |
resp = self.svc.zoneOperations().get(**self._default_args(operation=operation, | |
zone=zone)).execute() | |
return Operation(raw=resp, connection=self) | |
def await_operation(self, operation, zone=None): |
NewerOlder