Skip to content

Instantly share code, notes, and snippets.

View maxx-coffee's full-sized avatar
💭
Coding for funsies

Maxx Coffee maxx-coffee

💭
Coding for funsies
View GitHub Profile
defmodule Events.NewLead do
@moduledoc """
Module use to process the "new_lead" event.
example event:
%{
"tags" => [],
"gmaid" => "USA_22",
"state" => "NY",
"action" => "new_lead",
#pattern matching
# Definition for singly-linked list.
#
# defmodule ListNode do
# @type t :: %__MODULE__{
# val: integer,
# next: ListNode.t() | nil
# }
# defstruct val: 0, next: nil
import React from 'react';
import { render } from '@testing-library/react';
import CorrelationText from './CorrelationText';
import '@testing-library/jest-dom/extend-expect';
describe('<CorrelationText />', () => {
describe('more visits than clicks', () => {
it('should x times visits state', () => {
const props = {
data: {
clicks: 4400,
var path = require("path");
module.exports = {
stories: ["../src/**/*.stories.js", "../src/**/*.stories.mdx"],
webpackFinal: async (config) => {
const aliases = { ...config.resolve.alias };
config.output["globalObject"] = "this";
config.node = {
fs: "empty",
};
data = %Influxinator.Db.LocationMeasurement{}
data = %{data | tags: %{data.tags | identifier: 17, job_id: 22}}
data = %{data | fields: %{data.fields | lat: "test", long: "test", speed: 100}}
Influxinator.InfluxConnection.write(data)
defmodule Influxinator.Db.LocationMeasurement do
use Instream.Series
series do
database "influxinator"
measurement "location"
tag :identifier
tag :job_id
defmodule Influxinator.InfluxConnection do
use Instream.Connection, otp_app: :influxinator
end
FROM elixir:latest
MAINTAINER Josh Coffee
RUN apt-get update && apt-get install --yes postgresql-client nodejs inotify-tools
ADD . /app
RUN mix local.hex --force
RUN mix archive.install --force hex phx_new 1.4.16
WORKDIR /app
EXPOSE 4000
defmodule Dargons.DiceTest do
use ExUnit.Case
alias Dargons.Dice
describe "rolling dice" do
test "rolling a single D20" do
[first_dice | _] = dice = Dice.roll(20)
assert length(dice) == 1
assert first_dice <= 20
end
@maxx-coffee
maxx-coffee / tasker_states.md
Created September 18, 2019 13:03
tasker_states.md

Operations

State

Currently state is used for 2 purposes. The first purpose is to transition between states.

Example: Transition from select_url to audit_select_url

The second use of state is to signify if the operation is a system status. System statuses are used to perform an operation in our system.

Example: