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
require 'openai' | |
client = OpenAI::Client.new(access_token: ENV['openai_key']) | |
assistants = OpenAI::Assistants.new(client: client) | |
# assistant = assistants.create( | |
# parameters: { | |
# name: 'Math tutor', | |
# model: 'gpt-4', | |
# instructions: 'You are a personal math tutor. Write and run code to answer math questions.' |
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
require 'sidekiq/api' | |
# 1. Clear retry set | |
Sidekiq::RetrySet.new.clear | |
# 2. Clear scheduled jobs | |
Sidekiq::ScheduledSet.new.clear |
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
function modifyForWeichertImport() { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
var deleteSecondaryAddressColumn = true | |
var secondaryAddressColumnNumber = 4 | |
if (deleteSecondaryAddressColumn) { | |
// delete secondary address column | |
sheet.deleteColumn(secondaryAddressColumnNumber); |
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
/** | |
* Copyright 2019 Google LLC. | |
* SPDX-License-Identifier: Apache-2.0 | |
*/ | |
function getEnvironment() { | |
var environment = { | |
spreadsheetID: "<REPLACE WITH YOUR SPREADSHEET ID>", | |
firebaseUrl: "<REPLACE WITH YOUR REALTIME DB URL>" | |
}; |
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
# Converts time selectec time zone to time in Sydney Australia nad New Delhi in Rails | |
time_zones = ActiveSupport::TimeZone.all.map(&:name) | |
time_from = '2020-06-20 23:00:00' | |
Time.zone = time_zones.first #'America/New_York' | |
time_zones_to_convert_to = ["Australia/Sydney", "New Delhi"] | |
from_time = Time.zone.parse(time_from) | |
puts "From #{Time.zone} #{from_time}" | |
time_zones_to_convert_to.each do|to_zone| | |
puts "#{to_zone} #{from_time.in_time_zone(to_zone)}" |
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
# disallow dotbot crawler | |
User-agent: dotbot | |
Disallow: / |
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
tz = ActiveSupport::TimeZone.new("Islamabad") | |
# Time to be converted to Pak time | |
started_at = Time.now + 5.hours | |
started_at.in_time_zone(tz) |
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
# grep some lines and remove some text from each grepped line and save the output to a file | |
grep getConn PCCASHPOS*.out | grep -v "JDBC.getConn" | sed 's/^.*getConnection\|//' > /tmp/conn.out |
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
# Maven command to test a single class, also specifying a proxy server for remote communications | |
mvn -Dhttp.proxyHost=proxy_server -Dhttp.proxyPort=8900 test -Dtest=ServiceTest | |
# Maven command to print test report | |
mvn surefire-report:report-only | |
# maven goals to create a war without running tests | |
mvn -o clean compile war:war -Dmaven.test.skip=true |
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
# gem install using proxy | |
jruby -S gem install builder -p http://proxy-server:8080 |