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
$branchName = "" | |
$repoUrl = "" | |
$outputFolderName = "" | |
# 既存のフォルダがあれば削除 | |
if (Test-Path -Path $outputFolderName -PathType Container) { | |
Remove-Item -Path $outputFolderName -Recurse -Force | |
Write-Host "既存のフォルダ '$outputFolderName' を削除しました。" | |
} |
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
install_pkg() { | |
pkg="$1" | |
if command -v apt-get >/dev/null 2>&1; then | |
sudo apt-get install -y "$pkg" | |
elif command -v brew >/dev/null 2>&1; then | |
brew install "$pkg" | |
elif command -v yum >/dev/null 2>&1; then | |
sudo yum install -y "$pkg" | |
else | |
echo "No supported package manager found for installing $pkg" |
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 subprocess | |
import os | |
def get_tracked_files(): | |
"""Get a list of all files tracked by Git""" | |
result = subprocess.run('git ls-files', capture_output=True, text=True, shell=True) | |
if result.stderr: | |
raise Exception(f"Failed to retrieve Git files: {result.stderr}") | |
return result.stdout.splitlines() |
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 subprocess | |
def test_ollama(number): | |
# Create a prompt based on the number | |
prompt = f"Return the result of this expression: 1+{number}" | |
# Output the prompt with echo and pass it to ollama via pipe | |
command = f'echo "{prompt}" | ollama run deepseek-r1:latest' | |
result = subprocess.run( | |
command, | |
capture_output=True, text=True, shell=True |
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 os | |
import subprocess | |
def create_tree_from_lines(lines): | |
tree = {} | |
for line in lines: | |
parts = line.strip().split("/") | |
current_level = tree | |
for part in parts: |
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
// Get the element by class name | |
const scrollableDiv = document.querySelector('.react-scroll-to-bottom--css-gkooh-1n7m0yu'); | |
if (scrollableDiv) { | |
scrollableDiv.scrollTo({ | |
top: 0, | |
behavior: 'smooth' // Smooth scroll | |
}); | |
} else { | |
console.log("Element not found."); |
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
const buttons = document.querySelectorAll('button.btn-octicon.js-details-target'); | |
buttons.forEach(button => button.click()); |
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
from typing import List, Dict | |
import os | |
def find_file_paths(root_dir: str, target_files: List[str]) -> Dict[str, List[str]]: | |
""" | |
Search for specific files within a directory and its subdirectories using depth-first search. | |
Args: | |
root_dir (str): The root directory to start the search from. | |
target_files (List[str]): A list of target file names to search for. |
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
%xwEx2022-08-23 15:33:09.160 INFO 28024 --- [ost-startStop-1] r.c.j.JedisSentinelPool : Trying to find master from available Sentinels... | |
%xwEx2022-08-23 15:33:11.183 WARN 28024 --- [ost-startStop-1] r.c.j.JedisSentinelPool : Cannot get master address from sentinel running @ 10.48.32.11:6379. Reason: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out. Trying next one. | |
%xwEx2022-08-23 15:33:11.187 ERROR 28024 --- [ost-startStop-1] o.s.b.c.e.t.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'webMetricsFilter' defined in class path resource [io/micrometer/spring/autoconfigure/web/servlet/WebMvcMetricsAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.micrometer.spring.web.servlet.Web |
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 os | |
from pip._internal import main as pip_main | |
# config part START | |
fail_file_name = "failed-dependencies.config" | |
total_fails = 0 | |
to_retry = True | |
NewerOlder