Skip to content

Instantly share code, notes, and snippets.

View stevenwcarter's full-sized avatar

Steven Carter stevenwcarter

View GitHub Profile
@stevenwcarter
stevenwcarter / streams.java
Last active May 12, 2016 01:23
Java 7 -> 8
// Old way of writing it
List<PartFilter> partFilters = FilterQueryBuilder.getFilters(PartFilter.class, clonedFilters);
for (PartFilter f : partFilters) {
if (f.getPartTerms() != null) {
f.getPartTerms().remove("sub_category");
}
}
// New way with Java 8 Stream API and Lambda functions
FilterQueryBuilder.getFilters(PartFilter.class, clonedFilters).stream()
gpio.read(pin, function(err, value) {
if (err) throw err;
console.log(value);
});
function getX (callback) {
gpio.read(pin, function (err, value) {
if (err) throw err;
callback(value);
});
var spawn = require('child_process').spawn,
aws2js = require('aws2js'),
http = require('http'),
urlutil = require('url')
mime = require('mime'),
Buffers = require('buffers');
var settings = {
s3: {
key: 'key',
@stevenwcarter
stevenwcarter / Booty after Dracolich
Last active December 11, 2015 05:29
Items after dracolich encounter
# Magical Items
- Staff +5 thundering (bag)
- Dagger +5 (keen dagger) (bag)
- Belt - Giant's strength +4 (Chris)
- Bracers - armor +8 (Joe)
- Gloves of Dexterity +4 (Joe)
- (3) rings
- ring of protection +5 (Steve)
- ring of evasion (Chris)
- ring of freedom of movement (Steve)