Skip to content

Instantly share code, notes, and snippets.

View aponcz's full-sized avatar

Adam Poncz aponcz

View GitHub Profile
@aponcz
aponcz / Terraform module hierarchy.py
Last active August 23, 2023 17:59
Terraform module hierarchy
import networkx as nx
from pyparsing import *
import matplotlib.pyplot as plt
from pathlib import Path
from pprint import pprint
import sys
import re
if len(sys.argv) != 2:
uuid = SecureRandom.uuid
newline = "\r\n"
boundary = "----------#{Time.now.nsec}"
folder_id = 654664
file_path = Rails.root.join("sample.pdf")
file = File.read(file_path)
uri_str = "https://www4.idealsvdr.com/v3/api/File/UploadFile?contentLength=#{file.size}&fileName=#{file_path.basename.to_s}&folderId=#{folder_id}&resumeSize=0&uid=#{uuid}"
uri = URI.parse(uri_str)
class BaseModels < ActiveRecord::Migration[5.1]
def change
create_table :districts, id: :uuid do |t|
t.string :name
t.timestamps
end
create_table :schools, id: :uuid do |t|
t.references :district, foreign_key: true, type: :uuid
t.string :name
require "rails_helper"
feature "user registration", js: true do
let(:registration_page) { Pages::User::RegistrationPage.new }
scenario "customer signs in with email and password" do
sign_up_with "aponcz@example.com",
"password",
"password"
module API
module V1
class InvalidRequestError < StandardError; end
class UnprocessableEntityError < StandardError; end
class Unauthorized < StandardError; end
class APIController < ApplicationController
respond_to :json
rescue_from StandardError, with: :render_server_error unless Rails.env.development? or Rails.env.test?
create_table :policy_owners do |t|
t.integer :user_id
t.integer :policy_id
t.timestamps
end
create_table :policies do |t|
t.integer :policy_owner_id
t.string :number
t.integer :policy_type_id
multipleContactsAvailable: (->
@get('content.project.client.contacts.length') > 1
).property('content.project.client.contacts')
contacts: (->
@get('content.project.client.contacts')
).property('content.project.client.contacts')
content is a budget and this code never returns the contacts. Thoughts?
module API
module V1
class InvalidRequestError < StandardError; end
class UnprocessableEntityError < StandardError; end
class Unauthorized < StandardError; end
class APIController < ApplicationController
respond_to :json
rescue_from StandardError, with: :render_server_error unless Rails.env.development? or Rails.env.test?