Skip to content

Instantly share code, notes, and snippets.

function createDispatchAdvice(options) {
if (options.quantity) {
logger(`Setting quantity to ${options.quantity}`);
await DispatchAdviceEnvelope.addDispatchQuantity(options.quantity);
}
// blah blah
}
package spock
import org.openqa.selenium.remote.RemoteWebDriver
@Singleton
class BrowserInstance {
def RemoteWebDriver driver
}
<Authority auths={['foo', 'bar']}>
<Button>Click</Button>
</Authority>
### Keybase proof
I hereby claim:
* I am pulse00 on github.
* I am pulse00 (https://keybase.io/pulse00) on keybase.
* I have a public key ASDGEzgLn0m5jyZvWKqK4n6Usu_J2WJuK256bCfqG7unkgo
To claim this, I am signing this object:
// drop spring-data-rest and spring-rest-hateoas into your pom.xml
public interface BookRepository extends MongoRepository<Book, String> {
@Query(" {'name' : { $regex : '.*?0.*', $options: 'i' }} ")
Page<Book> filterBooksByName(@Param("term") String term, Pageable pageable);
}
// curl http://127.0.0.1:8080/book/search/filterBooksByName?term=Potter
// java < 8
if (document != null && document.getOrder() != null && document.getOrder().getAddress() != null && document.getOrder().getAddress().getStreet() != null) {
// boom
)
// java >= 8
Optional<Street> street = resolve(() -> document.getOrder().getAddress().getStreet());
if (street.isPresent() {
@pulse00
pulse00 / create_aws_api_group.py
Last active February 5, 2016 15:20 — forked from ErikHarmon/create_aws_api_group.py
Create AWS security group egress rules for AWS API access, using Ansible
#!/usr/bin/python
import json
import sys
# take json from stdin, from source such as https://ip-ranges.amazonaws.com/ip-ranges.json
# and turn it into an AWS security group using Ansible
region = 'eu-west-1'
header_str = """---
- hosts: 127.0.0.1
/*
* Licensed to the University Corporation for Advanced Internet Development,
* Inc. (UCAID) under one or more contributor license agreements. See the
* NOTICE file distributed with this work for additional information regarding
* copyright ownership. The UCAID licenses this file to You under the Apache
* License, Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
- name: Set image_id status
set_fact:
image_id: "{{region}}.{{os}}"
{ "rds_facts": {
"attempts": 0,
"changed": false,
"instance": {
"endpoint": null
}
}