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
import os | |
def reverse_dir(dirname): | |
reverse_d = {v[0]: f'{i + 1:03d}. {v[0][5:]}' for i, v in enumerate( | |
sorted({filename: int(filename[:3]) for filename in os.listdir(dirname)}.items(), key=lambda x: x[1], | |
reverse=True))} | |
for old_filename, new_filename in reverse_d.items(): | |
print(f'{old_filename} -> {new_filename}') | |
os.rename(os.path.join(dirname, old_filename), os.path.join(dirname, new_filename)) |
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
var fs = require('fs'); | |
const path = require('path'); | |
const UTF8 = 'utf8'; | |
const EXTENSION = '.wd14'; | |
const OUTPUT_FILE = 'words.txt'; | |
const EMPTY_STRING = ''; | |
const NEW_LINE_SEPARATOR = '\n'; | |
const COMA_SEPARATOR = ','; | |
const COMA_SPACE_SEPARATOR = ', '; |
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
$Algo = "MACTripleDES" | |
$current = Get-Location | |
if ($args[0] -ne $null) { | |
$Ext = $args[0] | |
} else { | |
$Ext = ".png" | |
} | |
$files = Get-ChildItem -Path $current.Path -Recurse | Where-Object {$_.Extension -eq $Ext} | |
Write-Output $files |
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
$current = Get-Location | |
$vols = Get-ChildItem -Path $current.Path -Directory | |
foreach ($vol in $vols) | |
{ | |
$chapters = Get-ChildItem -Path $vol.Name -Directory | |
foreach ($chapter in $chapters) | |
{ | |
$name = $chapter.Name |
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
$SelectPath = $args[0] # "D:\Photos\+stable-diffusion\lora\TriggerWord\IMG\N_TriggerWord\" | |
$TriggerWord = $args[1] # "TriggerWord" | |
if ($args[2] -ne $null) { | |
$FromExt = $args[2] | |
} else { | |
$FromExt = ".txt" | |
} | |
if ($args[3] -ne $null) { | |
$ToExt = $args[3] |
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
var fs = require('fs'); | |
const notesToTabs = [ | |
{ key: '𝄢[до]', val: 'Z' }, | |
{ key: '𝄢[ре]', val: 'X' }, | |
{ key: '𝄢[ми]', val: 'C' }, | |
{ key: '𝄢[фа]', val: 'V' }, | |
{ key: '𝄢[соль]', val: 'B' }, | |
{ key: '𝄢[ля]', val: 'N' }, | |
{ key: '𝄢[си]', val: 'M' }, |
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
$ crc start -p ~/Downloads/pull-secret.txt --log-level debug | |
DEBU CodeReady Containers version: 1.28.0+08de64bd | |
DEBU OpenShift version: 4.7.13 (not embedded in executable) | |
DEBU Running 'crc start' | |
DEBU Total memory of system is 17179869184 bytes | |
DEBU No new version available. The latest version is 1.28.0 | |
INFO Checking if running as non-root | |
INFO Checking if crc-admin-helper executable is cached | |
INFO Checking for obsolete admin-helper executable | |
DEBU Checking if an older admin-helper executable is installed |
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
$ crc delete -f | |
WARN open /Users/b/.kube/config: no such file or directory | |
Deleted the OpenShift cluster | |
$ crc cleanup | |
INFO Unload CodeReady Containers tray | |
INFO Removing launchd configuration for tray | |
INFO Removing /etc/resolver/testing file | |
INFO Unload CodeReady Containers daemon | |
INFO Stopping CRC Hyperkit process | |
INFO Removing hosts file records added by CRC |
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
#!/bin/bash | |
files="./files.out" | |
releasefiles="./release.out" | |
snapshotfiles="./snapshot.out" | |
username="admin" | |
password="admin123" | |
nexusurl="http://nexus/content/repositories/thirdparty/" | |
snapshoturl="http://nexus/content/repositories/Snapshots/" |
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 solution(A) { | |
function rightSum(A, N, i, res) { | |
i = typeof i !== 'undefined' ? i : 0; | |
res = typeof res!== 'undefined' ? res : 0; | |
if (i>=N) { | |
return res; | |
} else { | |
return rightSum (A, N, i+1, res+A[i]); | |
} |
NewerOlder