Skip to content

Instantly share code, notes, and snippets.

View Ananto30's full-sized avatar
🎯
Focusing

Azizul Haque Ananto Ananto30

🎯
Focusing
View GitHub Profile
@Ananto30
Ananto30 / hayday-analysis.ipynb
Last active September 23, 2021 17:27
Best item to produce in Hay Day. Analysis like price per minute, actual time to make a product, crop/tree timing, machinery timing etc are considered.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Ananto30
Ananto30 / zero_client.py
Last active December 17, 2021 17:00
Example usage of Zero framework
import asyncio
from zero import AsyncZeroClient
zero_client = AsyncZeroClient("localhost", 5559)
async def echo():
resp = await zero_client.call("echo", "Hi there!")
print(resp)
db[collection].aggregate(
[
{
"$search": {
"phrase": {
"query": term,
"path": "body_en",
"slop": 2,
},
"highlight": {"path": "body_en"},
db[collection].aggregate(
[
{
"$search": {
"text": {
"query": term,
"path": ["body_en", "chapter_en"],
"fuzzy": {"maxEdits": 1, "maxExpansions": 10},
},
"highlight": {"path": ["body_en", "chapter_en"]},
db[collection].aggregate(
[
{
"$search": {
"compound": {
"must": [
{
"text": {
"query": term,
"path": ["body_en", "chapter_en"],
[
{
"$search": {
"compound": {
"must": {
"text": {
"query": "Bangladeshi",
"path": "restaurant_name"
}
},
{
"mappings": {
"dynamic": false,
"fields": {
"body_en": {
"type": "string",
"analyzer": "lucene.standard"
},
"chapter_en": {
"type": "string",
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func HelloServer(w http.ResponseWriter, r *http.Request) {
package main
import (
"fmt"
"net/http"
"time"
"github.com/dgrijalva/jwt-go"
)
package main
import (
"fmt"
"net/http"
)
func HelloServer(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello World!")
}