Skip to content

Instantly share code, notes, and snippets.

View sheepla's full-sized avatar
🐑
メェ〜

sheepla sheepla

🐑
メェ〜
View GitHub Profile
@sheepla
sheepla / Save-ImageFromClipboard.ps1
Created January 10, 2021 12:57
クリップボードに保存してある画像をファイルに出力する。
function Save-ImageFromClipboard
{
[CmdletBinding()]
param(
[Parameter(ValueFromPipelineByPropertyName=$false, ValueFromPipeline=$false, Position=0, Mandatory=$false, HelpMessage="Path of image file that you want to save")]
[String] $Path,
[Parameter(ValueFromPipelineByPropertyName=$false, ValueFromPipeline=$false, Mandatory=$false, HelpMessage="Open default image viewer")]
@sheepla
sheepla / DirnameAndBasename.ps1
Created February 11, 2021 09:47
PowerShellでdirname/basename
function dirname
{
Param
(
[Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, Position=1,
HelpMessage="Files or directories for which you want to get the parent directory name")]
[String[]] $Path
)
foreach ($item in (Get-Item $Path)) {
function say
{
Param (
[Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$false, Position=1)]
[String] $Text
)
$spVoice= New-Object -ComObject Sapi.Spvoice
$spVoice.Speak($Text)
}
@sheepla
sheepla / ddg.json
Last active March 21, 2021 00:25
DuckDuckGoの自分用設定 (配色はiceberg)
{
"kae": "d",
"kax": "v266-1",
"ks": "m",
"kbc": "1",
"ko": "s",
"k7": "161821",
"kt": "n",
"k21": "1e2139",
"k9": "84a0c6",
@sheepla
sheepla / Set-WindowTitleAnimation.ps1
Created March 21, 2021 00:38
PowerShellのウインドウタイトルでアニメーション
1..30 | %{1..10+9..2 | %{$host.ui.RawUI.WindowTitle = "💩"*$_; sleep 0.06}}
@sheepla
sheepla / slack-sidebar-themes.md
Last active April 13, 2021 23:50
Slackのサイドバーテーマ。

Slack Sidebar Themes

Installation

  1. Copy these color codes.
  2. Open the following menu Preferences -> Themes.
  3. Paste it into the Colors item.

Or send a direct message to slackbot and click Switch sidebar theme.

format = """
[┌─ ](bold white)$shell$time$directory$git_branch$git_status$cmd_duration
[└─](bold white)$character"""
scan_timeout = 10
[character]
success_symbol = "[❯❯❯](bold white) "
error_symbol = "[❯❯❯](bold red) "
@sheepla
sheepla / radio.sh
Last active August 20, 2023 22:25
Listen to radio CLI with interactive menu
#!/bin/bash
# Listen to radio cli
# Dependence:
# - fzf: fuzzy finder
# - ffplay: music player (Install `ffmpeg`)
cat << EOS | ffplay -i -nodisp -v quiet "$(fzf <<< "${channels}" | awk '{print $2}')"
NHKR1 https://nhkradioakr1-i.akamaihd.net/hls/live/511633/1-r1/1-r1-01.m3u8
NHKR2 https://nhkradioakr2-i.akamaihd.net/hls/live/511929/1-r2/1-r2-01.m3u8
@sheepla
sheepla / urlencode.sh
Last active June 30, 2021 11:13
シェルスクリプトでURLエンコード
#!/bin/sh
printf "%s" "${*}" | od -tx1 -An | tr ' ' % | tr -d \\n
@sheepla
sheepla / fzpac-help.md
Last active September 24, 2021 11:01
fzpac-help.md

fzpac-help

sheepla/fzpacのオプション・サブコマンド再実装案

USAGE
    fzpac SUBCMD [KEYWORDS...]
    fzpac -h|--help
    fzpav -V|--version