Skip to content

Instantly share code, notes, and snippets.

@josefbetancourt
josefbetancourt / index.js
Last active Aug 12, 2016
Using Media Queries in React
View index.js
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 Jan 20, 2016
RxJS example of reactive toggable and cancellable process loop in browser
View Toggle.js
// 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';
View PruneDeletionTree.java
package com.octodecillion.learn.rxjava;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import rx.Observable;
/**
*
* @author jbetancourt
View DuplicatePropertyDetectorWithSubClass.java
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;
View DuplicatePropDetectWithCommonsConfig.java
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;
View DuplicatePropertyDetectorWithCGLIB.java
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;
View DuplicatePropertyDetectorWithJavassist.java
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;
View InitMap.java
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 Jan 3, 2016
Hello world using RxJava.
View HelloRxTest.java
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 Aug 29, 2015
Scan classpath for classes with @RequiresTest annotated methods
View RequiresTestAnnotationScanner.java
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;
You can’t perform that action at this time.