This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Streamlit application for querying invoice data using LangChain's pandas DataFrame agent. | |
Provides a simple interface for natural language queries on invoice data. | |
""" | |
import os | |
import pandas as pd | |
import streamlit as st | |
from langchain_experimental.agents import create_pandas_dataframe_agent | |
from langchain_openai import OpenAI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { handler } = require('./handler'); | |
jest.mock("@sentry/node", () => ({ | |
init: () => jest.fn(), | |
wrapHandler: () => jest.fn(), | |
})); | |
describe('handler', () => { | |
it('should return the correct response', async () => { | |
const event = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Sentry = require("@sentry/node"); | |
const { nodeProfilingIntegration } = require("@sentry/profiling-node"); | |
Sentry.init({ | |
dsn: "", | |
integrations: [ | |
nodeProfilingIntegration(), | |
], | |
tracesSampleRate: 1.0, | |
profilesSampleRate: 1.0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate the models Estado and Cidade: | |
# rails generate Estado sigla:string nome:string | |
# rails generate Cidade estado:references nome: string | |
# rails db:migrate | |
# Put this code on your db/seeds.rb of your Ruby On Rails application | |
# rails db:seed | |
Estado.destroy_all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
:AC=>"Acre", | |
:AL=>"Alagoas", | |
:AP=>"Amapá", | |
:AM=>"Amazonas", | |
:BA=>"Bahia", :CE=>"Ceará", | |
:DF=>"Distrito Federal", | |
:ES=>"Espírito Santo", | |
:GO=>"Goiás", | |
:MA=>"Maranhão", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ListingsController < ApplicationController | |
def index | |
movie_listing_service = ServiceLocator.get_service_instance(:MovieListing) | |
@available_movies = movie_listing_service.available_movies | |
render nothing: true #this is just an example don't get hung up on it :) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bulk merge a bunch of records | |
# | |
# we expect most of the records to import to represent updates | |
# so this method tries to be efficent with database queries | |
# by using a single query to find any existing records matching the key_attributes | |
# updating those records and finally inserting each remaining record | |
# | |
# It DOEST NOT use a transaction or lock. callers responsibilty to | |
# add that if desired | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def resize_nocrop_noscale(image, w,h) | |
w_original = image[:width].to_f | |
h_original = image[:height].to_f | |
if w_original < w && h_original < h | |
return image | |
end | |
# resize | |
image.resize("#{w}x#{h}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load_module /usr/local/opt/passenger/libexec/modules/ngx_http_passenger_module.so; | |
#user nobody; | |
worker_processes 2; | |
# worker_rlimit_nofile 30000; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; |
NewerOlder