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
| func Workflow(ctx workflow.Context, details PaymentDetails) error { | |
| ao := workflow.ActivityOptions{ | |
| StartToCloseTimeout: 10 * time.Second // This is the X seconds limit, currently set to 10 seconds | |
| } | |
| ctx = workflow.WithActivityOptions(ctx, ao) | |
| var result string | |
| err := workflow.ExecuteActivity(ctx, ProcessPaymentActivity, details).Get(ctx, &result) | |
| if err != nil { |
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
| public WorkflowExecutionStatus checkStatus(String workflowId) { | |
| DescribeWorkflowExecutionRequest request = DescribeWorkflowExecutionRequest.newBuilder() | |
| .setNamespace(client.getOptions().getNamespace()) | |
| .setExecution(WorkflowExecution.newBuilder().setWorkflowId(workflowId).build()) | |
| .build(); | |
| DescribeWorkflowExecutionResponse response = | |
| service.blockingStub().describeWorkflowExecution(request); | |
| return response.getWorkflowExecutionInfo().getStatus(); | |
| } |
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
| import uvicorn | |
| import chromadb | |
| import uuid | |
| import json | |
| import io | |
| from pypdf import PdfReader | |
| from PIL import Image | |
| from fastapi import FastAPI, UploadFile, File, Form, HTTPException | |
| from typing import Optional | |
| from chromadb.utils import embedding_functions |
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
| local user_host="%B%(!.%{$fg[red]%}.%{$fg[green]%})%n%{$reset_color%} " | |
| local user_symbol='%(!.#.$)' | |
| #Only show current and previous directory layer if more than 4 layers | |
| local current_dir="%B%{$fg[blue]%}%(4~|.../%2~|%3~) %{$reset_color%}" | |
| local vcs_branch='$(git_prompt_info)$(hg_prompt_info)' | |
| local rvm_ruby='$(ruby_prompt_info)' | |
| local venv_prompt='$(virtualenv_prompt_info)' | |
| if [[ "${plugins[@]}" =~ 'kube-ps1' ]]; then | |
| local kube_prompt='$(kube_ps1)' |
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
| $CSVFolder = 'C:\path\to\directory\with\csvs'; | |
| $OutputFile = 'C:\path\to\combined.csv'; | |
| $CSV = Get-ChildItem -Path $CSVFolder -Filter *.csv | ForEach-Object { | |
| Import-Csv -Path $_ | |
| } | |
| $CSV | Export-Csv -Path $OutputFile -NoTypeInformation -Force; |
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
| function global:Start-ForAllRepos | |
| { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Position=0)] | |
| [string] | |
| $Cmd = 'git status', | |
| [Parameter(Position=1)] | |
| [string[]] |
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
| import requests | |
| def download_file_from_google_drive(id, destination): | |
| def get_confirm_token(response): | |
| for key, value in response.cookies.items(): | |
| if key.startswith('download_warning'): | |
| return value | |
| return None |
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
| public class IncList<T> | |
| { | |
| private readonly IDictionary<T,int> _incList; | |
| public IncList() | |
| { | |
| _incList = new Dictionary<T, int>(); | |
| } | |
| public void Add(T item) |
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
| void Main() | |
| { | |
| int[] intArray = new int[]{ 51,83,2523,2452,124,656,254,115,15,5,5,15,156,4378,568,4,37,2,72,2,8,9,10,234,39,23,56,1,63,33}; | |
| var list = intArray.ToList(); | |
| list.Sort(); | |
| var find = search(list,656); | |
| find.Dump(); | |
| } |
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
| internal class GOL | |
| { | |
| private int _genCounter = 0; | |
| private bool[,] _board; | |
| private int _boardSize; | |
| public void Play() | |
| { | |
| Initialize(30); | |
| PrintBoard(); |
NewerOlder