View parse-int.clj
(defmulti parse-int (fn [x] (class x)))
(defmethod parse-int String [x]
(try (Integer/parseInt x) (catch RuntimeException re 0)))
(defmethod parse-int nil [_] 0)
(defmethod parse-int Number [x] x)
View utils.clj
(ns api-fetchers.utils
(:require [clj-time.format :as format-time]
[taoensso.timbre :as timbre :refer [info]])
(:import java.text.SimpleDateFormat
[java.time Duration Instant]
java.util.zip.ZipInputStream))
(defn unzip
"Returns a `ZipInputStream` with the contents of `input-stream`"
[input-stream]
View bold.clj
(defn bold [x]
(let [keys (seq "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ")
values ["\uD835\uDDD4"
"\uD835\uDDD5"
"\uD835\uDDD6"
"\uD835\uDDD7"
"\uD835\uDDD8"
"\uD835\uDDD9"
"\uD835\uDDDA"
"\uD835\uDDDB"
View utils.clj
(defn str->num [x]
(-> (NumberFormat/getInstance (Locale/forLanguageTag "en-US")) (.parse x)))
(defn numeric? [x]
(try
(str->num x)
(catch ParseException pe false)))
(defn vector-of-vectors? [x]
(every? vector? x))
View units.clj
(ns private.tmp.units)
(defn- ounces->kg
[input]
(let [lb 16 ;; 1kg → 16lb
oz 2.2] ;; 1kg → 2.2oz
(->> (/ input lb oz) (format "%.3f kg"))))
View index.css
.toggle {
cursor: pointer;
user-select: none;
display: flex;
align-items: center;
justify-content: left;
}
.toggle-phony {
opacity: 0;
View core.clj
(ns facebook-campaigns-resolver.core
(:require [cheshire.core :as json]
[clj-http.client :as http]
[amazonica.aws.s3 :as s3]
[amazonica.aws.s3transfer :as s3transfer]
[clojure.java.io :as io]))
(def ^:private url "https://jsonplaceholder.typicode.com/comments?postId=1")
(def ^:private aws {:key ""
View test.md

>! and <! are, simply put and take

View Visibility.js
import { Children, PropTypes } from 'react';
const Visibility = ({ visible, children }) => (
visible ? Children.only(children) : null
);
Visibility.defaultProps = {
visible: true,
};
View diff-package-json.js
/**
* Simple script that compares our npm manifest against Oscar's manifest
* and list all results that don't match versions.
*
* Usage:
*
* node tools/diff-package-json.js path/to/oscar/package.json
**/
const current = require('../package');