Skip to content

Instantly share code, notes, and snippets.

View zgunz42's full-sized avatar
๐Ÿ 
Working from home

I Kadek Adi Gunawan zgunz42

๐Ÿ 
Working from home
View GitHub Profile
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Data Seeding Schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"model": { "type": "string" },
"rows": {
"type": "array",
error[E0277]: the trait bound `fn(teloxide::Bot, teloxide::prelude::Dialogue<State, InMemStorage<State>>, Arc<std::sync::RwLock<context::Context>>, teloxide::prelude::Message) -> impl std::future::Future<Output = Result<(), Box<(dyn StdError + Send + Sync + 'static)>>> {start}: Injectable<_, _, _>` is not satisfied
--> src/chatbot/mod.rs:118:58
|
118 | .branch(dptree::case![State::Start].endpoint(start))
| -------- ^^^^^ the trait `Injectable<_, _, _>` is not implemented for fn item `fn(teloxide::Bot, teloxide::prelude::Dialogue<State, InMemStorage<State>>, Arc<std::sync::RwLock<context::Context>>, teloxide::prelude::Message) -> impl std::future::Future<Output = Result<(), Box<(dyn StdError + Send + Sync + 'static)>>> {start}`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `I
{
"status": "success",
"code": 200,
"message": "success",
"data": {
"rooms": [
{
"id": 631,
"icon": "no_icon",
"is_root": true,
package main
import "fmt"
//define the download() function
func download(value int, ch chan int) {
sum :=0
for i:=0; i <= value; i++ {
sum +=i
}
package main
import "fmt"
func main() {
var lastResult string
var sum int
fmt.Scanln(&lastResult)
results := []string{"w", "l", "w", "d", "w", "l", "l", "l", "d", "d", "w", "l", "w", "d"}
for _, val := range append(results, lastResult) {
package main
import "fmt"
type Timer struct {
id string
value int
}
func (t *Timer) tick() {
t.value +=1
package main
import "fmt"
func mars_age(age int) int {
return age * 365/687
}
func main() {
var age int
fmt.Scanln(&age)
package main
import "fmt"
func getUserInput(input interface{}) (int, error) {
var err error
switch t := input.(type) {
case *int:
_, err = fmt.Scanf("%d", input)
case *string:
@zgunz42
zgunz42 / README.txt
Created March 16, 2021 08:23
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.7.4+commit.3f05b770.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@zgunz42
zgunz42 / Mongo.md
Created December 31, 2020 00:46 — forked from jnewman12/Mongo.md
Data Modeling With Mongo

Data Modeling with MongoDB

mongo


Objectives

  • Understand model relationships in MongoDB
  • Understand One-to-Many relationships