Skip to content

Instantly share code, notes, and snippets.

View christhekeele's full-sized avatar
💜

Christopher Keele christhekeele

💜
View GitHub Profile
This file has been truncated, but you can view the full file.
{
"yieldstar_best": [
{
"Partner": "realpage",
"Data": {
"PhysicalProperty": {
"Property": {
"Building": { "@IDValue": "1", "Name": "N/A" },
"Floorplan": {
"Identification": { "@IDValue": "1" },
@christhekeele
christhekeele / ecto_adapter_custom.ex
Last active August 31, 2018 08:42
Scaffold for a full implementation of the Ecto Adapter behaviours. (Ecto v2.1.4)
defmodule Ecto.Adapter.Custom do
####
# Ecto.Adapter
##
# TYPES
# @type t :: Ecto.Adapter.t
@type t :: Ecto.Adapter.Custom
@christhekeele
christhekeele / matcha.ex
Last active April 17, 2018 22:19
Possible macro API for generating match patterns/specifications in Elixir
defmodule Matcha do
@moduledoc """
Documentation for Matcha.
"""
@doc """
Handles the sigil `~m`.
It returns a match pattern or specification.
@christhekeele
christhekeele / aliases.md
Last active February 22, 2018 09:14
Some git aliases

git chunk

git config --global alias.chunk 'add -p'

Usage: starts an interactive chunk-by-chunk staging session, similar to git rebase -i. Handy for picking apart a full index to make a nicer narrative of small commits.

git current

@christhekeele
christhekeele / mnemonix-passthrough-proxy.ex
Last active December 13, 2017 19:54
An example meta store for Mnemonix
defmodule Mnemonix.Stores.Meta.PassThrough do
@moduledoc """
A `Mnemonix.Store` that caches reads from a backend store into a frontend one.
Writes and removals are applied to both stores.
Works best with quicker or closer stores in the frontend, like in-memory ones;
with a store-wide ttl to keep their footprint light.
iex> {:ok, backend} = Mnemonix.Stores.Redix.start_link()
@christhekeele
christhekeele / styles.less
Last active December 8, 2017 15:37
My custom git color styling for Atom
// Colors selected to match the Twilight theme
@git-added-color: #8F9D6A;
@git-modified-color: #7587A6;
@git-removed-color: #CF6A4C;
// Blur inactive windows
body.is-blurred .workspace {
-webkit-filter: blur(0.13em) hue-rotate(19deg);
}
@christhekeele
christhekeele / mnemonix_repos.md
Last active July 2, 2017 12:52
How Mnemonix's repository pattern is implemented

Synopsis

Mnemonix is a key/value adapter library that employs a repository pattern. I wanted to support a few things with it:

  • Multiple 'feature sets'--collections of functions that may or may not be implemented for an adapter
  • A single unified API inside the core module incorporating all feature sets
  • Compile-time and runtime support for configuring repositories
  • Application-controlled and DIY repo supervision
  • The ability for library users to build custom modules with only particular feature sets
@christhekeele
christhekeele / prime.ex
Last active May 5, 2017 10:54
Infinite Prime Generator in Elixir
# Elixir v1.0.2
defmodule Prime do
def stream do
Stream.unfold( [], fn primes ->
next = next_prime(primes)
{ next, [next | primes] }
end )
end
@christhekeele
christhekeele / guard.ex
Last active September 17, 2016 04:38
Check quoted expressions for validity inside guards.
defmodule Guard do
@guardables ~W[
== != === !== > >= < <=
and or not
+ - * /
<>
in
is_atom is_binary is_bitstring is_boolean
is_float is_function is_integer is_list
@christhekeele
christhekeele / mix.exs
Last active May 21, 2016 19:09
Local Git Repos for Mix
defmodule MyApp.Mixfile do
use Mix.Project
def project do
[app: :my_app,
version: "0.0.1",
elixir: "~> 1.2",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps]