Skip to content

Instantly share code, notes, and snippets.

View KentaGoto's full-sized avatar
🍧
🚀🚀🚀🚀🚀

KentaGoto

🍧
🚀🚀🚀🚀🚀
  • Tokyo, Japan
  • 13:03 (UTC +09:00)
View GitHub Profile
# ドライブの使用状況を取得する
$diskUsage = Get-WmiObject Win32_LogicalDisk | Where-Object { $_.DriveType -eq 3 } | ForEach-Object {
[PSCustomObject]@{
'Drive' = $_.DeviceID
'UsedSpaceGB' = [math]::Round((($_.Size - $_.FreeSpace) / 1GB), 2)
'FreeSpaceGB' = [math]::Round(($_.FreeSpace / 1GB), 2)
'TotalSpaceGB' = [math]::Round(($_.Size / 1GB), 2)
}
}
@KentaGoto
KentaGoto / go-shot.go
Created June 24, 2023 00:29
Goでスクショ
package main
import (
"fmt"
"image/png"
"io"
"os"
"path/filepath"
"time"
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
)
<!DOCTYPE HTML>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(function(){
$(".focus").focus(function(){
if(this.value == "keyword"){
$(this).val("").css("color","#f39");
}
@KentaGoto
KentaGoto / sendMail.go
Last active December 24, 2019 08:00
Go で Mail
package main
import gomail "gopkg.in/gomail.v2"
// https://godoc.org/gopkg.in/gomail.v2#example-package
func sendMail(from, to, cc, subject, body string) {
m := gomail.NewMessage()
m.SetHeader("From", from)
m.SetHeader("To", to)
m.SetHeader("Cc", cc)
@KentaGoto
KentaGoto / main.go
Created December 6, 2019 06:59
Go: find_images
package main
import (
"fmt"
"image"
_ "image/gif"
_ "image/jpeg"
_ "image/png"
"os"
@KentaGoto
KentaGoto / dirwark.go
Last active December 6, 2019 06:55
Go: 再帰
package main
import (
"fmt"
"io/ioutil"
"path/filepath"
)
func main() {
paths := dirwalk(`D:\Temp_working\test`)
@KentaGoto
KentaGoto / check_ColorIndex.pl
Created December 6, 2019 02:43
Check Excel's font ColorIndex
use strict;
use warnings;
use utf8;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';
Win32::OLE->Option( CP=>Win32::OLE::CP_UTF8 );
use Win32::OLE::Variant;
###############################################################
# Check Excel's font ColorIndex
Option Explicit
Sub ExtractHighlightChars()
' 特定の色のついた文字を抽出する
Application.ScreenUpdating = False
Dim Start, Finish As Variant
Start = Time
@KentaGoto
KentaGoto / wgetool.go
Created May 30, 2018 00:48
for Windows.
package main
import (
"bufio"
"fmt"
"os"
"os/exec"
"strings"
)