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
@awolf
awolf / DOCKERFILE
Created Jan 13, 2019
Ruby and Docker - Dockerfile Sample
View DOCKERFILE
FROM ruby:2.2
RUN apt-get update && apt-get install -y build-essential
RUN mkdir -p /app
WORKDIR /app
RUN gem install bundler
@awolf
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
awolf / sample.java
Last active Jan 13, 2019
Brain Freeze from Clojure - Java Version
View sample.java
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.