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
curl -L http://127.0.0.1:4001/v2/keys/foo -XPUT -d value="some value" | |
curl -L http://127.0.0.1:4001/v2/keys/foo |
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
// Request | |
OPTIONS /v1/logs/logid HTTP/1.1 | |
Host: js.logentries.com | |
Connection: keep-alive | |
Access-Control-Request-Method: POST | |
Origin: https://logentries.com | |
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36 | |
Access-Control-Request-Headers: x-requested-with, content-type | |
Accept: */* |
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
List<Iterator<Event>> iterators = FluentIterable.from(source_keys) | |
.transform(source_key -> getIterator(tail_query, source_key)) | |
.filter(Predicates.notNull()) | |
.toList() |
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
@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS) | |
public static class Wrapper { | |
} | |
@Test | |
public void testPolymorphicTypeIsReturnedWithoutMap() throws Exception { | |
Wrapper alertNotifyTag = new Wrapper(); | |
String serialized = mapper.writeValueAsString(alertNotifyTag); |
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
/// | |
/// Parse + Logentries integration- based on this gist: https://gist.github.com/rogernolan/95ea615164e343b3bc54 | |
/// proof-of-concept; might have the odd typo | |
/// | |
var DEBUG = false; | |
var logger = (function(){ | |
// Rely on Parse.com using node module caching to not duplicate this stuff. |
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 Array | |
def include?(value) | |
self.each do |range| | |
return true if range.include?(value) | |
end | |
return false | |
end | |
end |
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 Account | |
def initialize(balance) | |
@balance = balance | |
end | |
def transfer_money(to,amount) | |
p "Sender now has #{balance - amount}" | |
p "Recipient now has #{to.balance + amount}" | |
end | |
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
curl -O http://www.smudge-it.co.uk/pub/apache/incubator/couchdb/0.8.1-incubating/apache-couchdb-0.8.1-incubating.tar.gz | |
tar -xzvf apache-couchdb-0.8.1-incubating.tar.gz; cd !$ | |
sudo port install automake autoconf libtool help2man spidermonkey taglib icu | |
./configure | |
make | |
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
sudo couchdb |
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 Integer | |
def round_to_nearest(*args) | |
most = self % args[0] | |
most > (args[0]/2)? self - most + args[0] : self - most | |
end | |
end | |
anumber = 349 | |
p anumber.round_to_nearest(50) |
OlderNewer