Skip to content

Instantly share code, notes, and snippets.

Adam J Wolf awolf

Block or report user

Report or block awolf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Created Jan 13, 2019
Ruby and Docker - Dockerfile Sample
FROM ruby:2.2
RUN apt-get update && apt-get install -y build-essential
RUN mkdir -p /app
RUN gem install bundler
awolf / Clojure.clj
Created Jan 13, 2019
Brain Freeze from Clojure - Clojure
View Clojure.clj
(defn indexed [coll] (map-indexed vector coll))
(defn index-filter [pred coll]
(when pred
(for [[idx elt] (indexed coll) :when (pred elt)] idx)))
(defn index-of-any [pred coll]
(first (index-filter pred coll)))
awolf /
Last active Jan 13, 2019
Brain Freeze from Clojure - Java Version
public static int indexOfAny(String str, char[] searchChars) {
if (isEmpty(str) || ArrayUtils.isEmpty(searchChars)) {
return -1;
for (int i = 0; i < str.length(); i++) {
char ch = str.charAt(i);
for (int j = 0; j < searchChars.length; j++) {
if (searchChars[j] == ch) {
return i;
You can’t perform that action at this time.