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
| #!/bin/sh | |
| # | |
| # MacのWi-Fiをトグルする | |
| # | |
| # See: http://qiita.com/r7kamura/items/b58c236eb1c3b1c38957 | |
| # See: http://gpsoft.dip.jp/hiki/?WiFi%E3%82%92%E3%83%88%E3%82%B0%E3%83%AB%28ON%2FOFF%29%E3%81%99%E3%82%8B | |
| if networksetup -getairportpower en0 | grep -F -q On | |
| then | |
| echo 'Wi-Fi を切にします...' |
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
| " vimrc | |
| let s:is_windows = has('win32') | |
| let $VIMDIR = expand(s:is_windows ? '~/vimfiles' : '~/.vim') | |
| if has('vim_starting') | |
| "let $PATH .= ';'.expand('~/bin') | |
| silent! autocmd! vimrcEx | |
| filetype off | filetype plugin indent off | |
| if s:is_windows |
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
| augroup clean-qflist | |
| autocmd! | |
| augroup END | |
| autocmd clean-qflist QuickFixCmdPost grep,lgrep | |
| \ call setqflist(filter(copy(getqflist()), 'v:val["valid"]'), 'r') |
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
| <?php | |
| ini_set('user_agent', 'OreOreAgent'); | |
| $url = 'https://api.github.com/repos/splhack/macvim-kaoriya/releases/latest'; | |
| $json = file_get_contents($url); | |
| $decoded = json_decode($json, true); | |
| $dmg_url = $decoded['assets'][0]['browser_download_url']; | |
| header("Location: $dmg_url", true, 303); | |
| exit(); |
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
| @echo off | |
| set USB_MEMORY_ROOT=%~d0 | |
| set HOME=%USB_MEMORY_ROOT%\home\todashuta | |
| set PATH=%USB_MEMORY_ROOT%\bin;%PATH% | |
| chdir %HOME% | |
| start %USB_MEMORY_ROOT%Apps\vim74-kaoriya-win32\gvim.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
| # 与えられたURLのタイトル (<title>(.*?)</title>) を取得し、 | |
| # "TITLE" {given-URL} という形式で出力する | |
| require 'open-uri' | |
| require 'nkf' | |
| ARGF.each do |url| | |
| title = NKF.nkf('-w', open(url).read.match(%r{<title>(.*?)</title>}m)[1]) | |
| print %("#{title.strip}" #{url.strip}) | |
| end |
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
| <?php | |
| /** | |
| * Add LiveReload script (only develop environment; e.g. localhost). | |
| */ | |
| if ( in_array( $_SERVER['REMOTE_ADDR'], array( '127.0.0.1', '::1' ) ) ): | |
| function add_livereload_script() { | |
| $src = '//localhost:35729/livereload.js?snipver=2'; | |
| // ハンドルとして使われる名称, src, 依存するスクリプトのハンドル配列, バージョン(?ver=XXとして追加される), footerに配置するか? | |
| wp_enqueue_script( 'livereload', $src, array(), '0.1', false ); | |
| } |
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
| #!/bin/sh | |
| factorial() { | |
| #[ $1 -gt 0 ] && echo $(( $1 * $(factorial $(( $1 - 1 ))) )) || echo 1 | |
| [ $1 -gt 0 ] && expr $1 '*' $(factorial $(expr $1 - 1)) || echo 1 | |
| } | |
| factorial 4 |
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
| #!/bin/sh - | |
| error() { | |
| echo "$*" 1>&2 | |
| } | |
| cd "$(cd $(dirname $0) && pwd)" || exit 1 | |
| #exec java -Xms1G -Xmx1G -d64 -jar minecraft_server.1.8.jar nogui | |
| slack="${HOME}/bin/slack" |
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
| $ speedtest-cli --list | peco | grep -o '^[0-9]\+' | xargs -I @ speedtest-cli --server @ |