Skip to content

Instantly share code, notes, and snippets.

<?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>
@cjmamo
cjmamo / pom.xml
Created July 1, 2015 13:18
Adding PostgreSQL to a Self-Contained Maven Build
<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>
package org.ossandme;
import org.milyn.Smooks;
import javax.xml.transform.stream.StreamSource;
public class CsvToDbTransformer {
public void transform() throws Exception {
@cjmamo
cjmamo / app(1).js
Last active March 15, 2017 11:29
Safely Prevent Template Caching in AngularJS
...
app.run(function($rootScope, $templateCache) {
$rootScope.$on('$viewContentLoaded', function() {
$templateCache.removeAll();
});
});
@cjmamo
cjmamo / Gemfile
Last active March 6, 2023 08:50
Dynamically Create BitCoin Wallets & Payment Pages on Coinbase in Ruby
...
# 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"
@cjmamo
cjmamo / AhcProcessor(1).java
Last active January 2, 2016 10:19
Scaling up Mule with Async Request Handling/Continuations
package org.ossandme;
...
// Naive implementation
public class AhcProcessor extends AbstractInterceptingMessageProcessor {
@Override
public MuleEvent process(final MuleEvent event) throws MuleException {
...
@cjmamo
cjmamo / MyConsumer.java
Last active June 6, 2016 02:02
Apache Kafka for Event Sourcing
...
public class MyConsumer {
private static final int SO_TIMEOUT = 100000; // socket timeout
private static final int BUFFER_SIZE = 64 * 1024; // maximum socket receive buffer in bytes
private static final int FETCH_SIZE = 100000; // maximum bytes to fetch from topic
public static void main(String args[]) {
MyConsumer myConsumer = new MyConsumer();
@cjmamo
cjmamo / bridge.cs
Last active December 21, 2015 18:09
Bridging Mule and MSMQ with ZeroMQ
using System;
using System.Text;
using ZeroMQ;
using System.Messaging;
namespace ConsoleApplication
{
class Bridge
{
static void Main(string[] args)
@cjmamo
cjmamo / error
Last active December 21, 2015 06:18
JRuby Complex Classes in Java Method Signatures
NoMethodError: undefined method `start_with?' for #<Java::OrgJrubyAstJava_signature::ReferenceTypeNode:0x3b9fa8f7>
as_java_type at /opt/jruby-1.7.4/lib/ruby/shared/jruby/compiler/java_signature.rb:20
parameters at /opt/jruby-1.7.4/lib/ruby/shared/jruby/compiler/java_signature.rb:48
each at file:/opt/jruby-1.7.4/lib/jruby.jar!/jruby/java/java_ext/java.util.rb:7
map at org/jruby/RubyEnumerable.java:713
parameters at /opt/jruby-1.7.4/lib/ruby/shared/jruby/compiler/java_signature.rb:48
types at /opt/jruby-1.7.4/lib/ruby/shared/jruby/compiler/java_signature.rb:54
java_signature at /opt/jruby-1.7.4/lib/ruby/shared/jruby/core_ext/class.rb:44
Foo at lib/example.rb:12
(root) at lib/example.rb:11
@cjmamo
cjmamo / example(1).rb
Last active December 20, 2015 18:29
JRuby CXF: A Gem for Creating SOAP Web Services
class HelloWorld
def say_hello(name)
return 'Hello ' + name
end
def give_age(age)
return 'Your age is ' + age.to_s
end