Skip to content

Instantly share code, notes, and snippets.

View kreas's full-sized avatar
:shipit:
Heathen

Tim Warren kreas

:shipit:
Heathen
View GitHub Profile
SUBTYPE_DEFINITIONS = {
# Indor Modular AHU
'23.73.13': {
min_outdoor_damper: {
descritpion: "Min Outdoor Damper?",
type: "boolean",
required: false,
column_name:
},
integral_return_fan: {
# From the rails productio console
# Set up the client connection to Twilio
client = Twilio::REST::Client.new TWILIO_SID, TWILIO_TOKEN
# Get the "main" queue, or the queue where a call is stuck.
main = Twilio::CallQueue.get_queue("main")
# You can see how many calls are in the queue by running
main.current_size
{
"meta_data": {
"total_pages": 229,
"total_entries": 2283,
"page_size": 10,
"page_number": 2,
},
"data": [
{
"user_defined_fields": {
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer:
" Tim Warren
" http://github.com/kreas
"
" Version:
" 1.1 - 2016-08-12
"
" Sections:
" * Vundle Packages & Setup
order = Order.find(id)
order.address = order.patient.address unless order.address
order.save
defmodule Just do
defstruct value: nil
end
defmodule Nothing do
defstruct value: nil
end
defmodule Maybe do
defstruct id: :nothing, value: nil
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer:
" Tim Warren
" http://github.com/kreas
"
" Version:
" 1.1 - 2016-08-12
"
" Sections:
" * Vundle Packages & Setup
{
subtypes: { ... },
frequency_id: value,
frequency: { ... },
description: string,
code: string,
category_id: value,
category: { ... },
sections: [
{
// GET request to sleepcoach.com
// Authorization "Sleepcoach Authentication Token"
{
"patients": [
{ "first_name": "Tim",
"last_name": "Warren",
//company name has to be same as in Brighttree
"company_name": "MNSLLS",
"deliviery_address": {
"street_addresss": "1234 Test Address",
@kreas
kreas / queue_example.ex
Created March 28, 2018 14:33
Example of using erlang queues for efficient FIFO (first in first out) processing.
# Create a new queue
iex> q = :queue.new()
# Add 1 to the queue. Remember Elixir is immutable so :queue.in(1, q) returns a new queue
iex> q = :queue.in(1, q)
...> {[1], []}
# Add a few more
iex> q = :queue.in(2, q)
...> {[2], [1]}