Skip to content

Instantly share code, notes, and snippets.

@josefbetancourt
josefbetancourt / index.js
Last active August 12, 2016 01:55
Using Media Queries in React
import React from 'react';
import {render} from 'react-dom';
import "babel-polyfill";
import invariant from "invariant";
/**
* A P P
*
*/
var App = React.createClass({
@josefbetancourt
josefbetancourt / Toggle.js
Last active January 20, 2016 13:06
RxJS example of reactive toggable and cancellable process loop in browser
// Toggle.js RxJS example of reactive toggable and cancellable process loop
// By: Josef Betancourt
// Date: Jan 11, 2016
// =========== Model
var counter = 1;
var runningState = true;
var msg = '';
var runButtonValue = 'Start';
package com.octodecillion.learn.rxjava;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import rx.Observable;
/**
*
* @author jbetancourt
package com.octodecillion.util;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
package com.octodecillion.util;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
package com.octodecillion.util;
import java.io.IOException;
import java.io.Reader;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
package com.octodecillion.util;
import java.io.IOException;
import java.io.Reader;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
package com.octodecillion.util;
import java.util.Map;
import java.util.Map.Entry;
/**
* A {@link Map} decorator that allows
* <a href="https://en.wikipedia.org/wiki/Fluent_interface#Java">Fluent</a>
* add of entries.<p>
*
@josefbetancourt
josefbetancourt / HelloRxTest.java
Last active January 3, 2016 01:50
Hello world using RxJava.
package com.octodecillion.learn.rxjava;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.junit.Before;
@josefbetancourt
josefbetancourt / RequiresTestAnnotationScanner.java
Last active August 29, 2015 14:25
Scan classpath for classes with @RequiresTest annotated methods
package com.octodecillion.test;
import java.lang.reflect.Method;
import java.util.List;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
import org.springframework.core.type.ClassMetadata;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.MetadataReaderFactory;
import org.springframework.core.type.filter.TypeFilter;