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');
View replace_strings.sh
# This script will take care of react-specific imports just so
# Preact can do its job (production only)
modules=./node_modules
bin=$modules/.bin
replace=$bin/replace
pattern="require\('react\/lib\/ReactDOMFactories'\)"
target=$modules/remarkable-react/lib/lib/renderer.js
if [ ! -d "$modules" ]; then
View markdown-image.js
const MATCH_MARKDOWN_IMAGE = /\!\[(.*)\]\((.*)\)/gm;
const MATCH_INLINE_IMAGE = /\(inline\)/i;
class MarkdownImage {
// We receive both `markdown` and `containerWidth` on the constructor here
static updateImageTags(markdown) {
let updatedMarkdown = markdown;
let match;
let matches = [];
View component.js
import Preact from 'preact'
import { StyleSheet, css } from 'aphrodite/no-important'
class Component extends Preact.Component {
constructor () {
super()
this._rawStyles = this.styles ? this.styles() : {}
this._styles = StyleSheet.create(this._rawStyles)
this._parseClassNames = this._parseClassNames.bind(this)
View index.js
// Polyfills
import 'promise-polyfill';
import 'whatwg-fetch';
import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { Redirect, Router, Route, IndexRoute, browserHistory } from 'react-router';
import configureStore from './store/configureStore';