Skip to content

Instantly share code, notes, and snippets.

View marklin-latte's full-sized avatar

MarkLin marklin-latte

View GitHub Profile
@marklin-latte
marklin-latte / dabblet.css
Created March 23, 2016 17:05
Diamond images — via transforms
/**
* Diamond images — via transforms
*/
.diamond {
width: 250px;
height: 250px;
transform: rotate(45deg);
overflow: hidden;
margin: 100px;
@marklin-latte
marklin-latte / dabblet.css
Last active March 23, 2016 15:37
Flexible background positioning
/**
* Flexible background positioning
* via extended background-position
*/
div {
background: url(http://csssecrets.io/images/code-pirate.svg)
no-repeat bottom right #58a;
background-position: right 20px bottom 10px;
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/listCardTitle"
android:layout_width="fill_parent"
android:layout_alignParentTop="true"
android:layout_height="26dip"
@marklin-latte
marklin-latte / gist:c57a9ce01ed1a48f9932
Created November 24, 2014 06:21
ElasticSearch-Update Child Field
//URI:POST
http://localhost:9200/11687/document/8132/_update?parent=6675
11687 is index.
document is type.
8132 is documentId
//Json
{
@marklin-latte
marklin-latte / gist:021e324e25cbc15cbc0c
Last active August 29, 2015 14:09
ElasticSearch-Update Index analysis
Step1.
Uri:POST
http://localhost:9200/test/_close
==========================================================================================================================================
Step2.
Uri:PUT
http://localhost:9200/test/_settings
@marklin-latte
marklin-latte / gist:182febfb7e177a08c290
Last active August 29, 2015 14:09
ElasticSearch-CreaetParentChildMapping
//Create Parent mapping
Uri:Put
http://localhost:9200/test1/_mapping/content
Json:
{
"content" : {
"properties" : {
@marklin-latte
marklin-latte / gist:eb68f321de4283293530
Created November 18, 2014 06:35
ElasticSearch-CRUD Multifields Type
//Create Mapping
Uri : PUT
localhost:9200/test1/_mapping/testtype
(test1 is index)
(testtype is typename)
Json:
{
@marklin-latte
marklin-latte / gist:f53b5ad092e5e5c6be50
Created November 18, 2014 01:58
ElasticSearch-search index mapping
//URI
GET http://localhost:9200/test1/_mapping
(test1 is index)
//Result
{
"test1": {
"mappings": {
@marklin-latte
marklin-latte / gist:0710a9bbd1b3abaaaa4c
Last active August 29, 2015 14:09
ElasticSearch-Attachment highlight search
//Uri
GET /test/person/_search
{
"fields": [],
"query": {
"match": {
"file": "天氣"
}
@marklin-latte
marklin-latte / gist:f2a52cced96eeb25c85d
Last active August 29, 2015 14:09
ElasticSearch-Analyze index text result
//Uri
http://localhost:9200/test1/_analyze?text='世界如此之大'
//Display Result
{
"tokens": [
{
"token": "世界",