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
@startuml | |
'''' Declarations for title, caption, etc '''' | |
'''' Declarations to stylize the diagram '''' | |
hide circle | |
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 source and destination file name | |
$fileName = Read-Host -Prompt 'Source file name' | |
$content = Get-Content $fileName | |
$newFileName = Read-Host -Prompt 'New file name' | |
# get line number | |
$start = Read-Host -Prompt 'Starting line number' | |
$end = Read-Host -Prompt 'Ending line number' | |
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 assert = require('assert').strict | |
function russianPeasantAlgo(a, b) { | |
aArray = [] | |
bArray = [] | |
// process first number | |
while (a > 0.99) { | |
aArray.push(a) | |
a = Math.trunc(a / 2) |
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
dateString=$(date +"%Y-%m-%d") | |
timeString=$(date +"%H:%M:%S") | |
content="-- [ $dateString ] [ $timeString ] --" | |
# Preserve the current value of the clipboard | |
clipboard=$(xsel -b -o) | |
# Put text in primary buffer for Shift+Insert pasting | |
echo -n "$content" | xsel -p -i |
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
#snoit.ps1 | |
#snoit stands for 'search n open in typora' | |
#### For Linux | |
# $typora_path = 'typora' | |
#### For Windows | |
$typora_path = 'C:\Program Files\Typora\typora.exe' |
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 Create-AesManagedObject($key, $IV) { | |
$aesManaged = New-Object "System.Security.Cryptography.AesManaged" | |
$aesManaged.Mode = [System.Security.Cryptography.CipherMode]::CBC | |
$aesManaged.Padding = [System.Security.Cryptography.PaddingMode]::Zeros | |
$aesManaged.BlockSize = 128 | |
$aesManaged.KeySize = 256 | |
if ($IV) { | |
if ($IV.getType().Name -eq "String") { | |
$aesManaged.IV = [System.Convert]::FromBase64String($IV) | |
} |