This file contains hidden or 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
... | |
# remember to use the forked version of coinbase-ruby: https://github.com/claudemamo/coinbase-ruby | |
gem "coinbase", "~> 1.3.0" | |
gem "oauth2", "~> 0.9.3" |
This file contains hidden or 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
... | |
app.run(function($rootScope, $templateCache) { | |
$rootScope.$on('$viewContentLoaded', function() { | |
$templateCache.removeAll(); | |
}); | |
}); |
This file contains hidden or 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 org.ossandme; | |
import org.milyn.Smooks; | |
import javax.xml.transform.stream.StreamSource; | |
public class CsvToDbTransformer { | |
public void transform() throws Exception { |
This file contains hidden or 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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
... | |
<build> | |
... | |
<plugins> | |
... | |
<plugin> | |
<groupId>com.github.adrianboimvaser</groupId> |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
... | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.codehaus.cargo</groupId> | |
<artifactId>cargo-maven2-plugin</artifactId> |
This file contains hidden or 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
Rule highValueOrderRule = new Rule(); | |
Condition highValueOrderCondition = new Condition(); | |
highValueOrderCondition.setField("price"); | |
highValueOrderCondition.setOperator(Condition.Operator.GREATER_THAN); | |
highValueOrderCondition.setValue(5000.0); | |
// In reality, you would have multiple rules for different types of events. | |
// The eventType property would be used to find rules relevant to the event | |
highValueOrderRule.setEventType(Rule.eventType.ORDER); |
This file contains hidden or 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
#%RAML 0.8 | |
title: Secure API | |
version: v1 | |
baseUri: https://opensourcesoftwareandme.blogspot.com/api | |
securedBy: [apiKey] | |
securitySchemes: | |
- apiKey: | |
type: x-custom | |
description: Authentication by API key |
This file contains hidden or 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
import org.jose4j.jwk.RsaJsonWebKey; | |
import org.jose4j.jwk.RsaJwkGenerator; | |
... | |
private void registerPublicKey() throws Exception { | |
TokenServiceContext context = TokenServiceContext.getInstance(); | |
RsaJsonWebKey rsaJsonWebKey = RsaJwkGenerator.generateJwk(2048); | |
rsaJsonWebKey.setKeyId(context.getNodeId()); | |
ConfigurationDataMapper.insertConfiguration(context.getNodeId(), "PUBLIC_KEY", rsaJsonWebKey.toJson()); | |
context.setKey(rsaJsonWebKey); |
This file contains hidden or 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
CREATE TABLE PERSON ( | |
id bigserial primary key, | |
first_name varchar(255) not null, | |
last_name varchar(255) not null | |
); |
This file contains hidden or 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
SELECT * FROM | |
(SELECT *, DENSE_RANK() OVER (ORDER BY name, id) count FROM | |
(SELECT *, DENSE_RANK() OVER (ORDER BY name, id) offset_ FROM | |
(SELECT a.id, a.name, b.title | |
FROM AUTHOR a, BOOK b | |
WHERE a.id = b.authorId) result) result_offset | |
WHERE offset_ > 0) result_offset_count | |
WHERE count <= 2 |