This file contains 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
from langchain import OpenAI, LLMChain | |
from langchain import PromptTemplate, FewShotPromptTemplate | |
from langchain.llms import LlamaCpp | |
import csv | |
examples = [ | |
{"product": "Toothpaste", | |
"category": "Health:Dental"}, | |
{"product": "Toilet Flapper", | |
"category": "Home:Maintenance"}, |
This file contains 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
from langchain import OpenAI, LLMChain, PromptTemplate | |
from langchain import PromptTemplate, FewShotPromptTemplate | |
from langchain.chains import LLMChain | |
from langchain.llms import LlamaCpp | |
from langchain.prompts import PromptTemplate | |
import csv | |
examples = [ | |
{"product": "Toothpaste", | |
"category": "Health:Dental"}, |
This file contains 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
#!/usr/bin/env ruby | |
# typed: ignore | |
# Makes PostgreSQL > 9 syntax compatible with < 10 | |
sql = File.open('./db/structure.sql', 'r+') | |
inside_create_sequence = false | |
out = '' | |
sql.each_line do |line| | |
if inside_create_sequence && line.strip == 'AS integer' |
This file contains 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
// +build windows | |
package main | |
import ( | |
"errors" | |
"golang.org/x/sys/windows/registry" | |
"golang.org/x/sys/windows/svc/eventlog" | |
) |
This file contains 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
#!/usr/bin/ruby | |
require "rom" | |
require "rom/memory" | |
class Users < ROM::Relation[:memory] | |
schema do | |
attribute :id, Types::Int | |
attribute :name, Types::String |
This file contains 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
#!/usr/bin/ruby | |
require 'rom' | |
configuration = ROM::Configuration.new(:memory, 'memory://test') | |
class AppointmentInfoRepository < ROM::Repository::Root | |
root :appointment_info | |
commands :create |
This file contains 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
# Lines configured by zsh-newuser-install | |
HISTFILE=~/.histfile | |
HISTSIZE=10000 | |
SAVEHIST=100000 | |
setopt appendhistory autocd beep nomatch | |
unsetopt notify | |
bindkey -e | |
# End of lines configured by zsh-newuser-install | |
# The following lines were added by compinstall | |
zstyle :compinstall filename '/home/reed/.zshrc' |
This file contains 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 LoadLocation < Interactor | |
def call | |
@response.location = location.attributes | |
@response | |
end | |
def location | |
LocationRepository.joins(:manager) | |
.select("*, user_repository.name AS manager_name") | |
.where(account_repository_id: @request.current_account_id) |
This file contains 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 UsersController < ApplicationController | |
respond_to :html | |
before_filter :authenticate_user! | |
def user_params | |
params.require(:user).permit :first_name, :last_name, :email, :password, :password_confirmation, :phone | |
end | |
private :user_params | |
def index |
This file contains 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
# == Schema Information | |
# | |
# Table name: user_repository | |
# | |
# id :integer not null, primary key | |
# account_repository_id :integer | |
# first_name :text | |
# last_name :text | |
# state :text | |
# email :string(255) default(""), not null |
NewerOlder