curl -i -XPUT http://localhost:8098/search/index/my_index
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
@doc """ | |
Inserts a link to the show path of a resource item. The | |
item must implement .id. | |
##Example | |
<%= read_more_link @conn, @post %> | |
""" | |
def read_more_link(conn, item) do |
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
export const isObjectEqual = (obj1, obj2) => { | |
if(!isObject(obj1) || !isObject(obj2)) { | |
return false; | |
} | |
// are the references the same? | |
if (obj1 === obj2) { | |
return true; | |
} |
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
nodes |
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 React from 'react' | |
import { observer } from 'mobx-react' | |
function ArtistList({ uiState: { artistData } }) { | |
const { data } = artistData; | |
if ( !data || !data.artists || !data.artists.length ) { | |
return <div>No artists bruh.</div> | |
} | |
const { artists } = data | |
return ( |
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
This gist captures what needs to be done to add a new field to Riak's Yokozuna | |
search index. | |
Sources: | |
- https://github.com/basho/yokozuna/issues/130 | |
- http://riak-users.197444.n3.nabble.com/How-to-update-existed-schema-td4032143.html | |
The code below is for illustration purposes only. Use at your own risk. | |
1. Create/Update new schema file |
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
curl -XPOST http://localhost:8098/types/location_type/buckets/people/datatypes/person1 \ | |
-H "Content-Type: application/json" \ | |
-d ' | |
{ | |
"update": { "username_register": "user1", "city_register": "Denver", "state_register": "NY", "position_register": "42.27,-74.53" } | |
}' | |
curl -XPOST http://localhost:8098/types/location_type/buckets/people/datatypes/person2 \ | |
-H "Content-Type: application/json" \ | |
-d ' |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<schema name="geotest" version="1.5"> | |
<uniqueKey>_yz_id</uniqueKey> | |
<fields> | |
<field name="name" type="string" indexed="true" stored="true"/> | |
<field name="loc" type="location_rpt" indexed="true" stored="true" /> | |
<!-- Begin Yokozuna Fields --> | |
<field name="_yz_id" type="_yz_str" indexed="true" stored="true" required="true" /> |
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
# Just for perf, you can skip this. | |
START_SEC=$(date +'%s') | |
# Creating network. | |
docker-machine ssh node-1 "docker network create --driver overlay proxy" | |
# Grab the source. | |
docker-machine ssh node-1 "curl -o docker-compose-stack.yml https://raw.githubusercontent.com/vfarcic/docker-flow-proxy/master/docker-compose-stack.yml" | |
# Create docker-flow-proxy and docker-flow-swarm-listener services. |
This gist is an implementation of http://sirile.github.io/2015/05/18/using-haproxy-and-consul-for-dynamic-service-discovery-on-docker.html on top of Docker Machine and Docker Swarm.