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/sh | |
########################### | |
## Shell script to clone a list of github repositories and run `mvn clean install` on each one of them | |
## | |
## Usage: put a file called `repos.txt` in the folder of the script containing the repository URLs, line by line: | |
## | |
##https://github.com/pulse00/Composer-Eclipse-Plugin.git | |
##git@github.com:pulse00/Symfony-2-Eclipse-Plugin.git | |
##etc |
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
<?php | |
namespace Snc\RedisBundle\Session\Storage\Handler; | |
/** | |
* Sessionhandler to serialize PHP sessions into redis using json as | |
* format. | |
* | |
* This way we can read the session in node.js websockets. | |
* |
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
package com.example.actors.github | |
import spray.httpx.Json4sSupport | |
import org.json4s.{DefaultFormats, Formats} | |
/** | |
* Marshalling/Unmarshalling for the github json format | |
* | |
* see http://developer.github.com/v3/oauth/#web-application-flow | |
*/ |
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
function createDispatchAdvice(options) { | |
if (options.quantity) { | |
logger(`Setting quantity to ${options.quantity}`); | |
await DispatchAdviceEnvelope.addDispatchQuantity(options.quantity); | |
} | |
// blah blah | |
} |
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
server { | |
listen 80; | |
server_name localhost; | |
access_log /path/to/jolokia.access.log; | |
location / { | |
if ($request_method = OPTIONS ) { | |
add_header Access-Control-Allow-Origin "*"; # <--- customize this | |
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS"; |
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
package spock | |
import org.openqa.selenium.remote.RemoteWebDriver | |
@Singleton | |
class BrowserInstance { | |
def RemoteWebDriver driver | |
} |
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
<Authority auths={['foo', 'bar']}> | |
<Button>Click</Button> | |
</Authority> |
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
### 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: |
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
// 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 |
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
// 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() { |
NewerOlder