Discover gists
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 python | |
import json | |
import sys | |
import time | |
from datetime import datetime | |
from pathlib import Path | |
""" | |
Parse nginx logs into a JSON log event stream for CloudWatch: |
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
<?xml version="1.0" encoding="utf-8"?> | |
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<files> | |
<file path="C:\ProgramData\chocolatey\lib\advtor\AdvOR-0.3.1.2.zip.txt" checksum="6EB52D0A761ED7266D0933798B69144D" /> | |
<file path="C:\ProgramData\chocolatey\lib\advtor\advtor.nupkg" checksum="8981A26B498101D6A6FCDBDF2D41684F" /> | |
<file path="C:\ProgramData\chocolatey\lib\advtor\advtor.nuspec" checksum="A87052CBF6F913CBAB5205E7C02F6D07" /> | |
<file path="C:\ProgramData\chocolatey\lib\advtor\tools\chocolateyInstall.ps1" checksum="980AE8261C3031A02B623AB5F284AFFF" /> | |
<file path="C:\ProgramData\chocolatey\lib\advtor\tools\AdvOR\AdvOR-English.lng" checksum="B29DBFE8F999AFE812868FA7FF9A1D0B" /> | |
<file path="C:\ProgramData\chocolatey\lib\advtor\tools\AdvOR\AdvOR.dll" checksum="AA65C7D2890AF6ABD5BD431ECC16D581" /> | |
<file path="C:\ProgramData\chocolatey\lib\advtor\tools\AdvOR\AdvOR.exe" checksum="ADEDD8C6BB7E2D893733E426ABB15F6 |
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
Option Explicit | |
'/functions | |
Function IsArrayInitialized(arr As Variant) As Boolean | |
On Error Resume Next | |
IsArrayInitialized = IsArray(arr) And Not IsEmpty(arr) And UBound(arr) >= 0 | |
On Error GoTo 0 | |
End Function |
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
public class WeightedRandomList | |
{ | |
private int weightSum; | |
private List<int> weights; | |
public int WeightSum => weightSum; | |
public List<int> Weights => weights; | |
public WeightedRandomList(List<int> weights) | |
{ |
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
<?xml version="1.0" encoding="utf-8"?> | |
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<files> | |
<file path="C:\ProgramData\chocolatey\lib\advor\AdvOR-0.3.1.2.zip.txt" checksum="1CF65A3B4CC103411B30EF2337C9084A" /> | |
<file path="C:\ProgramData\chocolatey\lib\advor\advor.nupkg" checksum="BD318EA7A1D544A72A164D6D8824C2D2" /> | |
<file path="C:\ProgramData\chocolatey\lib\advor\advor.nuspec" checksum="E09BF9E8F7E41E3808AEDAA338695724" /> | |
<file path="C:\ProgramData\chocolatey\lib\advor\tools\chocolateyInstall.ps1" checksum="2354E99F91A97C75C68E4AFBF9B3F458" /> | |
<file path="C:\ProgramData\chocolatey\lib\advor\tools\AdvOR\AdvOR-English.lng" checksum="B29DBFE8F999AFE812868FA7FF9A1D0B" /> | |
<file path="C:\ProgramData\chocolatey\lib\advor\tools\AdvOR\AdvOR.dll" checksum="AA65C7D2890AF6ABD5BD431ECC16D581" /> | |
<file path="C:\ProgramData\chocolatey\lib\advor\tools\AdvOR\AdvOR.exe" checksum="ADEDD8C6BB7E2D893733E426ABB15F67" /> |
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
# Homework: Classes (4 Tasks + 5 Exercises) | |
# Read carefully until the end before you start solving the exercises. | |
# Practice the Basics | |
# TASK 1: Basic Class | |
# - Create an empty class HouseForSale | |
# - Create two instances. | |
# - Add number_of_rooms and price as instance attributes. | |
# - Create print statements that show the attribute values for the instances. | |
class HouseForSale: |
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
Pipeline still running ... | |
PipelineRun is still running: Tasks Completed: 22 (Failed: 1, Cancelled 0), Incomplete: 1, Skipped: 9 | |
[set-github-started-label : post-comment] + EXTRA_ARGS= | |
[set-github-started-label : post-comment] + [[ ! -z operator-release-pipeline/started ]] | |
[set-github-started-label : post-comment] + EXTRA_ARGS+=' --add-labels operator-release-pipeline/started' | |
[set-github-started-label : post-comment] Editing GitHub labels to PR https://github.com/redhat-openshift-ecosystem/redhat-marketplace-operators/pull/968 | |
[set-github-started-label : post-comment] + [[ ! -z pipeline/trigger-release ]] | |
[set-github-started-label : post-comment] + EXTRA_ARGS+=' --remove-labels pipeline/trigger-release' | |
[set-github-started-label : post-comment] + [[ true == \t\r\u\e ]] | |
[set-github-started-label : post-comment] + EXTRA_ARGS+=' --remove-matching-namespace-labels' |
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
def vector_db_search(user_liked_paper, collection_name, num_results): | |
start_time = time.time() | |
search_results = abstract_collection.query( | |
query_embeddings=[user_liked_paper['embedding']], | |
n_results=num_results, | |
# Make sure the results don't contain the same paper as the query | |
where={"doi": {"$ne": user_liked_paper['doi']}} | |
) | |
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
2025-02-11 20:17:50,553 2572 [DEBUG] - XmlConfiguration is now operational | |
2025-02-11 20:17:50,675 2572 [DEBUG] - Adding new type 'CygwinService' for type 'IAlternativeSourceRunner' from assembly 'choco' | |
2025-02-11 20:17:50,691 2572 [DEBUG] - Adding new type 'CygwinService' for type 'IInstallSourceRunner' from assembly 'choco' | |
2025-02-11 20:17:50,691 2572 [DEBUG] - Adding new type 'PythonService' for type 'IAlternativeSourceRunner' from assembly 'choco' | |
2025-02-11 20:17:50,691 2572 [DEBUG] - Adding new type 'PythonService' for type 'IListSourceRunner' from assembly 'choco' | |
2025-02-11 20:17:50,691 2572 [DEBUG] - Adding new type 'PythonService' for type 'IInstallSourceRunner' from assembly 'choco' | |
2025-02-11 20:17:50,719 2572 [DEBUG] - Adding new type 'PythonService' for type 'IUninstallSourceRunner' from assembly 'choco' | |
2025-02-11 20:17:50,719 2572 [DEBUG] - Adding new type 'RubyGemsService' for type 'IAlternativeSourceRunner' from assembly 'choco' | |
2025-02-11 20:17:50,719 2572 [DEBUG] - Adding new typ |
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
// TODO: bloc use clean arthiteture | |
lib/ | |
├── core/ | |
│ ├── constants/ | |
│ ├── errors/ | |
│ ├── network/ | |
│ ├── theme/ | |
│ ├── utils/ | |
│ └── services/ | |
├── data/ |