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
$parent_folder = drive = "d:\" + Get-Date -UFormat %y | |
$daily_folder = Get-Date -UFormat %m%d | |
$path = $parent_Frive + $parent_folder + $daily_folder | |
New-Item -Path $path -ItemType Directory -Force |
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 json | |
import lzma | |
import nltk | |
import random | |
nltk.download('twitter_samples') | |
my_filters = [ | |
{"id": lzma.FILTER_LZMA2, "preset": 9 | lzma.PRESET_EXTREME}, | |
] |
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 lzma | |
import nltk | |
import random | |
nltk.download('reuters') | |
nltk.download('brown') | |
nltk.download('gutenberg') | |
my_filters = [ | |
{"id": lzma.FILTER_LZMA2, "preset": 9 | lzma.PRESET_EXTREME}, |
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
$OneNote = New-Object -ComObject OneNote.Application | |
Add-Type -assembly Microsoft.Office.Interop.OneNote | |
$target_id = "{A969C2B3-B790-0EDD-2E5A-9D834611888C}{1}{E1950583228671326940781911959017434812881141}" | |
$publish_path = "G:\work\onenote\export.docx" | |
$pandoc_path = "p:\myapp\pandoc-3.1.2" | |
$markdown_path = "G:\work\onenote\export.md" | |
$OneNote.Publish( |
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 makeCSV($hierarchy, $node_depth){ | |
$data = @() | |
foreach ($item in $hierarchy.ChildNodes){ | |
$data += makeCSVitem $node_depth $item | |
} | |
return $data | |
} |
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 printAll($hierarchy, $indent_level){ | |
foreach ($item in $hierarchy.ChildNodes){ | |
printName $item $indent_level $False | |
} | |
} | |
function printName($items, [int]$indent_level, [bool]$printID){ | |
$indent = "`t" * $indent_level | |
foreach($item in $items){ |
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
$myISO = 'E:\ISO\Microsoft Bookshelf Basic\BSBASIC2.ISO' | |
Mount-DiskImage $myISO | |
$vol = Get-DiskImage $myISO | Get-Volume | |
$old_drv = $vol.DriveLetter + ':' | |
$new_drv = 'X:' | |
#WMI | |
#Get-WmiObject -Class Win32_Volume | Where-Object {$_.DriveLetter -eq $old_drv} | Set-WmiInstance -Arguments @{DriveLetter=$new_drv} |
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
from moviepy.editor import * | |
folder_path = '/content/drive/MyDrive/20230404/' | |
movie_name = 'screen-20230331-142030.mp4' | |
gif_name = '20230404.gif' | |
source_path = folder_path + movie_name | |
target_path_ffmpeg = folder_path + 'ffmpeg' + gif_name | |
target_path_imageio = folder_path + 'imageio' + gif_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
from moviepy.editor import * | |
def getCroppedFrames(movie, crop_size, resize_size): | |
cropped_movie = movie.crop(x1=0, y1=0, width=crop_size["w"], height=crop_size["h"]) | |
resized_movie = cropped_movie.resize(height=resize_size["h"]) | |
return resized_movie | |
def makeGIF(path, movie, fps, program): |
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 cv2 | |
from PIL import Image | |
def getCroppedFrames(movie, crop_size, resize_size): | |
ret_images = [] | |
while True: | |
ret, bgr_images = movie.read() |
NewerOlder