This file contains 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
storefront = { | |
'AL':'143575', | |
'DZ':'143563', | |
'AO':'143564', | |
'AI':'143538', | |
'AG':'143540', | |
'AR':'143505', | |
'AM':'143524', | |
'AU':'143460', | |
'AT':'143445', |
This file contains 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
# | |
# Slightly tighter CORS config for nginx | |
# | |
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
# | |
# Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
# don't seem to play nicely with this. | |
# |
This file contains 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
bin/logstash -e 'input { | |
stdin { | |
} | |
} | |
filter { | |
ruby { | |
code => "event['hello'] = 'world'" | |
} | |
} |
This file contains 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
//console.log(stringDateToEpoch("2016-01-31T21:52:02.607Z")) | |
var obj = { "rank_history": [ | |
{"date": "2016-02-17T04:27:16.773Z","rank": 121}, | |
{"date": "2016-02-15T05:37:16.773Z","rank": 122}, | |
[1455763092,153], | |
[1455761092,154], | |
{"date": "2016-02-14T02:27:16.773Z","rank": 125}, | |
[1455781509,156] | |
] |
This file contains 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
input { | |
redis { | |
host => "xxx.com" | |
tags => [ "keywords" ] | |
data_type => "list" | |
key => "keywords_list" | |
codec => json | |
db => 2 | |
} | |
} |
This file contains 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
bin/logstash -e ' | |
input { | |
stdin { } | |
} | |
output { | |
elasticsearch { | |
hosts=>["localhost"] | |
index => "testing" | |
} | |
stdout {codec => rubydebug } |
This file contains 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
#!/bin/bash | |
# Install prerequisites | |
yum install -y gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel ruby-devel gcc-c++ jq git | |
# Import key | |
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - | |
# Install RVM | |
curl -sSL https://get.rvm.io | bash -s stable --ruby |
This file contains 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
class NilClass | |
def blank? | |
true | |
end | |
def not_blank? | |
!blank? | |
end | |
end | |
class String | |
def blank? |
This file contains 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
filter { | |
if [type] == "abc" { | |
metrics { | |
meter => "events" | |
add_tag => "metric" | |
} | |
} |
This file contains 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
input { | |
stdin { | |
type => "typeA" | |
} | |
} | |
filter { | |
if [type] == "typeA" { |
OlderNewer