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
[
{
"id": 5905,
"metadata": {
"id": "64af135897f8dac77eff254e",
"body": "\nThis rye-based cocktail got its name from drinkers who scoffed at Prohibition. \nIngredients:\n\n¾ oz Real Grenadine \n\n1 ½ oz rye whiskey\n1 oz dry vermouth\n¾ oz lemon juice\n\nInstructions:\n\nAdd all ingredients to a cocktail shaker\nFill with ice and shake for 10 seconds\nStrain into a chilled coupe \n\nGlass:\n\ncoupe\n\nGarnish:\n\nlemon peel\n",
"name": "Scofflaw",
"slug": "scofflaw",
"tags": "4-5, autumn, dry vermouth, lemon, real grenadine, shaken, short, spring, strong, summer, whiskey, winter",
"document": "BODY: \nThis rye-based cocktail got its name from drinkers who scoffed at Prohibition. \nIngredients:\n\n¾ oz Real Grenadine \n\n1 ½ oz rye whiskey\n1 oz dry vermouth\n¾ oz lemon juice\n\nInstructions:\n\nAdd all ingredients to a cocktail shaker\nFill with ice and shake for 10 seconds\nStrain into a chilled coupe \n\nGlass:\n\ncoupe\n\nGarnish:\n\nlemon peel\n\n\ntags: 4-5
[
{
"raw": {
"arrivalstatus": null,
"billingaccountid": null,
"billingaccountids": null,
"contextualpricing": null,
"customerhandoffcharge": 0,
"customfields": [
{
@kreas
kreas / job-post.json
Created September 25, 2020 14:33
Example Job Post Wizard
{
"steps": [
{
"title": "Ready to Post a Gig?",
"body": "Just follow the following prompts to build your job post. You'll have a chance to review and edit everything before you submit.",
"actions": [
{
"component": "Button",
"text": "Giddy Up",
"action": "nextStep"
"data": [
{
"id": 209536,
"created_at": "2018-07-30 14:26:00",
"updated_at": "2020-03-18 11:49:49",
"deleted_at": null,
"machine_type_id": 1712,
"machine_brand_id": 336,
"machine_model_id": 436956,
"condition_id": 3,
require('dotenv').config()
const { Pool } = require('pg')
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
ssl: true,
pool: 1
})
pool.connect()
-- View for search vectors
CREATE OR REPLACE VIEW vw_listing_search AS
SELECT
stock_number,
to_tsvector(coalesce(description, '')) ||
to_tsvector(coalesce(b.name, '')) ||
to_tsvector(coalesce(t.name, '')) ||
to_tsvector(coalesce(mm.name, '')) AS search_vector
FROM listings
LEFT JOIN brands b ON (listings.brand->>'id')::INT = b.machine_hub_id
package main
import (
"fmt"
)
const (
isAdmin = 1 << iota
isPMAdmin
@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]}
// 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",
{
subtypes: { ... },
frequency_id: value,
frequency: { ... },
description: string,
code: string,
category_id: value,
category: { ... },
sections: [
{