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
| <script type="text/javascript" src="http://gist.github.com/{{ .Get 0 }}.js"></script> |
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
| { | |
| "mappings": { | |
| "properties": { | |
| "field1": { | |
| "analyzer": "ik_syno_max", | |
| "search_analyzer": "ik_syno_smart", | |
| "type": "text" | |
| }, | |
| "field2": { | |
| "analyzer": "ik_syno_max", |
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
| // request | |
| { | |
| "text": "流行性感冒", | |
| "analyzer": "ik_syno_max" | |
| } | |
| // response | |
| { | |
| "tokens": [ | |
| { | |
| "token": "流感", |
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
| { | |
| "mappings": { | |
| "properties" : { | |
| "completion_field" : { | |
| "type" : "search_as_you_type", | |
| "analyzer": "ik_max_word" | |
| } | |
| } | |
| } | |
| } |
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
| // request 1 | |
| { | |
| "completion_field": "甲狀腺腫大" | |
| } | |
| // request 2 | |
| { | |
| "completion_field": "甲狀腺凸眼症" | |
| } | |
| ... |
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
| // request | |
| { | |
| "_source": ["completion_field"], | |
| "query": { | |
| "multi_match": { | |
| "query": "甲狀", | |
| "type": "best_fields", // 按照有對應到的順序計算 | |
| "fields": [ | |
| "completion_field" | |
| ] |
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 os | |
| import apache_beam as beam | |
| from apache_beam.io.avroio import ReadFromAvro | |
| from apache_beam.options.pipeline_options import (PipelineOptions, | |
| GoogleCloudOptions, | |
| StandardOptions, SetupOptions, | |
| WorkerOptions) | |
| from apache_beam.runners.runner import PipelineState | |
| import happybase | |
| from apache_beam.metrics import Metrics |
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
| <?php | |
| if (!function_exists('jsonEncode')) { | |
| function jsonEncode($payload, int $options = 0, int $depth = 512): string | |
| { | |
| $defaultOptions = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE; | |
| $options = 0 !== $options ? $options : $defaultOptions; | |
| $json = \json_encode($payload, $options, $depth); |
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
| if (/rv:11|MSIE|Trident|firefox/i.test(navigator.userAgent)) { | |
| notSupport = !navigator.mediaDevices || !navigator.getUserMedia | |
| } else { | |
| notSupport = !navigator.mediaDevices.getUserMedia | |
| } | |
| if (notSupport) { | |
| alert('getUserMedia not support on your browser') | |
| return | |
| } | |
| if (!navigator.mediaDevices.getUserMedia) { |
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
| # encoding=utf-8 | |
| import smtplib | |
| from email.mime.multipart import MIMEMultipart | |
| from email.mime.text import MIMEText | |
| import threading | |
| import codecs | |
| import logging | |
| import time | |
| from email.header import Header | |
| from email.utils import formataddr |
OlderNewer