Skip to content

Instantly share code, notes, and snippets.

View hkrishna's full-sized avatar

Harish Krishna hkrishna

View GitHub Profile
@hkrishna
hkrishna / violation_codes.markdown
Created December 27, 2015 02:11
List of all violation codes
  1. 4761 g
  2. 4719 c
  3. 4723 ab
  4. 4723 f
  5. 4713 c
  6. 4733 b
  7. 4757 b
  8. 8115 a
  9. 4713 d
  10. 4725 a1
@hkrishna
hkrishna / daycare-violations.markdown
Last active December 27, 2015 02:11
Exhaustive list of all daycare violation summaries
  1. Child care service failed to arrange/conduct criminal/SCR background clearance checks for required individuals failed to re-clear required individuals with the SCR every two years
  2. At time of inspection it was determined that child care service allows staff to perform their duties that are not healthy or are incapable of carrying out their duties Staff medical clearances are not maintained by child care service
  3. At time of inspection it was determined that child care service failed to ensure staff received required training within time frames and/or failed to maintain training records
  4. The owner or agent tenant or manager fails to maintain building in safe manner Structural integrety not maintained Building not free of pests Adequate heat ventilation and lighting not provided Not free of nuisances/hazards
  5. Emergency lighting in halls stairs not provided where required
  6. Camp equipment not maintained not of safe design or properly installed
  7. Food service area in child care service not free
@hkrishna
hkrishna / categories.sh
Last active August 29, 2015 14:20
Categories Aggregation query
# get the number of distinct category values in the index
curl -XGET "http://localhost:9200/pelias/_search?search_type=count" -d'
{
"aggs": {
"categories": {
"cardinality": {
"field": "category"
}
}
}
@hkrishna
hkrishna / categories.json
Created April 28, 2015 18:43
Categories and count
{
"took":344,
"timed_out":false,
"_shards":{
"total":40,
"successful":40,
"failed":0
},
"hits":{
"total":165113284,
@hkrishna
hkrishna / regression_explained.md
Last active August 29, 2015 14:19
[Pelias Regressions] Explanations for a few search queries
@hkrishna
hkrishna / gist:58f1b9bd22608eaf97d5
Created April 9, 2015 18:59
Setting number of replicas to 0
curl -XPUT localhost:9200/_template/marvel_custom -d '
{
"order" : 1,
"template" : ".marvel*",
"settings" : {
"number_of_replicas" : 0
}
}'
@hkrishna
hkrishna / gist:288e643589c8856c7309
Last active August 29, 2015 14:18
Dealing with unassigned shards
for shard in $(curl -XGET http://localhost:9200/_cat/shards | grep UNASSIGNED | awk '{print $2}'); do
curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
"commands" : [ {
"allocate" : {
"index" : "pelias",
"shard" : $shard,
"node" : "pelias-1",
"allow_primary" : true
}
}
@hkrishna
hkrishna / gist:d0a3ffab8160f1ddef0d
Last active August 29, 2015 14:08
Set up Pelias (Quick and Dirty)

mkdir pelias

Schema

git clone git@github.com:pelias/schema.git
npm install

install plugin

(if you used homebrew to install elasticsearch it should be /usr/local/Cellar/elasticsearch)

@hkrishna
hkrishna / citibike_router.rb
Created July 23, 2014 15:34
A quick and dirty script that fetches bike routes from mapzen's osrm service and converts points geom (from the input geojson) into linestrings
#!/usr/bin/env ruby
require 'json'
require 'net/http'
require 'nokogiri'
json = File.read('citibike_in.geojson')
data = JSON.parse(json)
out = data