Skip to content

Instantly share code, notes, and snippets.

View miwarin's full-sized avatar

Susumu Miwa miwarin

View GitHub Profile
@polyvertex
polyvertex / iglob_hidden.py
Created March 26, 2016 11:01
A glob.iglob that include dot files and hidden files
import glob
def iglob_hidden(*args, **kwargs):
"""A glob.iglob that include dot files and hidden files"""
old_ishidden = glob._ishidden
glob._ishidden = lambda x: False
try:
yield from glob.iglob(*args, **kwargs)
finally:
glob._ishidden = old_ishidden
@CannoHarito
CannoHarito / #NowPlaying.bat
Last active December 28, 2023 06:38
Windows版iTunesで再生中の楽曲を#NowPlayingをつけてツイートするページを開く cmd版,WSH(JScript)版,Powershell版
powershell (New-Object -C 'iTunes.Application').CurrentTrack^|%%{start('https://twitter.com/intent/tweet?text='+[Uri]::EscapeDataString(\"#NowPlaying $($_.Name) - $($_.Artist) ($($_.Album))\"))}
@CannoHarito
CannoHarito / iTunesServer.ps1
Last active March 10, 2024 13:03
win10用 httpサーバ経由でiTunesプレイリストを再生するpowershell
param([int]$port = 18180)
$url = "http://localhost:$port/"
function Invoke-ITunesServer {
param([Parameter(Mandatory)][string]$Url)
$iTunesApplication = Get-ITunesApplication
$iTunesPlaylists = $iTunesApplication.LibrarySource.Playlists
$listener = New-Object Net.HttpListener
$listener.Prefixes.Add($Url)
Write-Host "Listening... at $Url"