Skip to content

Instantly share code, notes, and snippets.

Chris Martin trbngr

  • Phoenix, AZ, USA
Block or report user

Report or block trbngr

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
View clipboard.history.json
{
"version": 2,
"clips": [
{
"value": "ActivateMasterSubContract",
"createdAt": 1563590194076,
"copyCount": 1,
"useCount": 0,
"language": "elixir",
"createdLocation": {
@trbngr
trbngr / results
Last active May 24, 2019
roman numerals benchmarks
View results
Operating System: macOS
CPU Information: Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz
Number of Available Cores: 8
Available memory: 16 GB
Elixir 1.8.1
Erlang 21.2
Benchmark suite executing with the following configuration:
warmup: 2 s
time: 5 s
@trbngr
trbngr / dates.ex
Last active Mar 23, 2019
parse dates
View dates.ex
defmodule Dates do
@valid_dates [
Date.utc_today() |> Date.to_iso8601(),
NaiveDateTime.utc_now() |> NaiveDateTime.to_iso8601(),
DateTime.utc_now() |> DateTime.to_iso8601()
]
|> Enum.map(&to_string/1)
|> Enum.join(" or ")
@invalid_date_message "Invalid date. Expected formated date. ie #{@valid_dates}"
@trbngr
trbngr / retryable.ex
Last active Dec 20, 2018
Elixir Retryable
View retryable.ex
defmodule Retryable do
require Logger
@enforce_keys [:mfa]
defstruct mfa: nil,
retries: 1,
should_retry: nil,
before_execution: nil
@trbngr
trbngr / KnightsDialer.ex
Last active Oct 10, 2018
Knights Dialer in Elixir.
View KnightsDialer.ex
defmodule KnightsDialer do
@nieghbors_map %{
1 => [6, 8],
2 => [7, 9],
3 => [4, 8],
4 => [3, 9, 0],
5 => [],
6 => [1, 7, 0],
7 => [2, 6],
8 => [1, 3],
@trbngr
trbngr / install.sh
Last active Sep 19, 2018 — forked from jeherve/install.sh
Installing my favorite apps on a new machine https://jeremy.hu/homebrew-cask-automate-mac-install/
View install.sh
#!/bin/sh
echo Install all AppStore Apps at first!
# If you are looking into a solution to automate AppStore installs,
# check mas https://github.com/argon/mas
# I installed XCode, Forklift.
read -p "Press any key to continue... " -n1 -s
echo '\n'
# Install Homebrew
@trbngr
trbngr / App.js
Last active Feb 19, 2019
Render hidden, allow download.
View App.js
import React from 'react';
import Pdf from './Pdf';
import PdfRenderer from './PdfRenderer';
export default () => (
<PdfRenderer
fileName="settlements.pdf"
buttonClasses="btn btn-secondary view-pdf"
extra={1}
@trbngr
trbngr / Syntax.cs
Last active Sep 14, 2017
experiments in graphql-dotnet syntax
View Syntax.cs
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using GraphQL;
using GraphQL.Builders;
using GraphQL.Resolvers;
using GraphQL.Types;
using LanguageExt;
using static LanguageExt.Prelude;
View build.sbt
name := "eff-study"
version := "1.0"
scalaVersion := "2.12.1"
scalacOptions ++= Seq(
"-Ypartial-unification",
"-language:postfixOps",
"-language:implicitConversions",
"-language:higherKinds"
)
View HttpMediator.scala
package com.company
import akka.actor.ActorSystem
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.model.Uri
import akka.util.Timeout
import com.company.Crawler.Destination
import com.company.model.AliasRequest
import scala.concurrent.duration._
You can’t perform that action at this time.