I hereby claim:
- I am therealng on github.
- I am therealng (https://keybase.io/therealng) on keybase.
- I have a public key ASAnKV36G5jO3sGHecTY6zd8LCyrYxKc_3TbFgEmSfdGqwo
To claim this, I am signing this object:
class ShoppingCartTest < MiniTest::Test | |
def setup | |
@cart = ShoppingCart.new | |
end | |
def test_calculates_total_price_with_taxes | |
item = Item.new("Apple", 10.00) | |
# Stubbing the add_item method | |
@cart.stub(:add_item, nil) do |
require "rspec" | |
describe "ShoppingCart" do | |
before { @cart = ShoppingCart.new } | |
describe "#total_price_with_taxes" do | |
it "calculates the total price with taxes" do | |
# Mocking external calls | |
allow(TaxCalculator).to receive(:calculate_tax).and_return(1.50) |
from langchain.prompts.example_selector import LengthBasedExampleSelector | |
example_selector = LengthBasedExampleSelector( | |
examples=examples, | |
example_prompt=example_prompt, | |
max_length=50 # this sets the max length that examples should be | |
) | |
dynamic_prompt_template = FewShotPromptTemplate( | |
example_selector=example_selector, # use example_selector instead of examples |
from langchain import FewShotPromptTemplate | |
# create our examples | |
examples = [ | |
{ | |
"query": "How are you?", | |
"answer": "I can't complain but sometimes I still do." | |
}, { | |
"query": "What time is it?", | |
"answer": "It's time to get a watch." |
import time | |
import redis | |
from flask import Flask | |
app = Flask(__name__) | |
cache = redis.Redis(host='redis', port=6379) | |
def get_hit_count(): | |
retries = 5 |
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'Hello, World!' | |
if __name__ == "__main__": | |
app.run() |
I hereby claim:
To claim this, I am signing this object:
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
def show | |
respond_with User.find(params[:id]) | |
end | |
def create | |
user = User.new(user_params) | |
if user.save | |
render json: user, status: :created, location: [:api, user] | |
else | |
render json: { errors: user.errors }, status: :unprocessable_entity |
def current_user | |
@current_user ||= User.find_by(auth_token: request.headers["Authorization"]) | |
end |