This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ((nil | |
| . ((indent-tabs-mode . nil) | |
| (c-basic-offset . 2) | |
| (tab-width . 2)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun my/extract-email (line) | |
| "Return the email address found in the LINE." | |
| (when (string-match "<\\([^>]+\\)>" line) | |
| (match-string 1 line))) | |
| (defun my/filter-emails-by-domain (text domain) | |
| "From the TEXT, find all emails with the DOMAIN." | |
| (let* ((lines (split-string text "\n" t)) | |
| (result '())) | |
| (dolist (ln lines result) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Merge non-trivial map entries. | |
| * Filters out | |
| * - null | |
| * - undefined | |
| * - NaN | |
| * - empty arrays | |
| * - empty strings | |
| */ | |
| export const mergeMaybe = (map: object, maybeMap?: unknown) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Cmr.Collections do | |
| alias Finch | |
| alias Jason | |
| @doc """ | |
| Returns a list of collections for a provider. | |
| """ | |
| def get_provider_collections(provider) do | |
| query_params = "?provider_id=#{provider.id}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set AWS Profile Environment Variables | |
| _parse_property() { | |
| cut -d '=' -f 2 <<< "$1" | xargs | |
| } | |
| aws_profile() { | |
| profile=false | |
| IFS='=' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns parse-semver | |
| (:require | |
| [clojure.edn :as edn] | |
| [cloure.string :as str]) | |
| (defn- version-exceeds-min? | |
| "Takes an array of integer version values and compares if the version exceeds a min" | |
| [versions min-versions] | |
| (let [v (first versions) | |
| m (or (first min-versions) 0)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns game-of-life) | |
| (defn make-grid | |
| "Return a vector representing a square 2d-array with random cells alive" | |
| [size] | |
| (for [y (range size) | |
| x (range size)] | |
| (> 20 (rand-int 100)))) | |
| (defn safe-sqrt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns util.equivalence) | |
| (defn nearly= | |
| "Double precision equivalency check." | |
| ([a b] | |
| (nearly= a b 6)) | |
| ([a b precision] | |
| (< (Math/abs (- a b)) | |
| (Math/pow 10 (- precision))))) |