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
| function lan_speed_one_liner | |
| set -l host $argv[1] | |
| set -l datasize $argv[2] | |
| printf "password: " | |
| read -l pass | |
| echo $pass | sudo -S ping -c 10 -s $datasize $host | grep avg | cut -d\/ -f5 | awk '{print $1/1000}' | awk '{print 120000/$1}' | awk '{print $1*8/1024/1024"Mbps"}' | |
| 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
| function lan_speed | |
| set -l host $argv[1] | |
| echo 'host ' $host | |
| set -l size $argv[2] | |
| echo 'size ' $size | |
| set -l count $argv[3] | |
| echo 'count ' $count |
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
| function random_emoji | |
| if count $argv >/dev/null | |
| set emojis $argv | |
| else | |
| set emojis ♨ 🐟 ⚡ 🐳 🗿 🔥 🌻 🎐 🌿 🍷 🌹 🎀 🌺 🌱 🗻 🌼 🎠 🌈 🐝 🌊 🚃 🐧 🌷 🚀 🌙 🎩 🐍 🐞 🌕 🍒 🍎 🍓 | |
| end | |
| set emoji $emojis[(math (random)%(count $emojis)+1)] | |
| echo -n " $emoji " | |
| 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
| fullBrewUpdate(){ | |
| brew update | |
| brew cask update | |
| casks=( $(brew cask list) ) | |
| for cask in ${casks[@]} | |
| do | |
| # in the first line there is version | |
| current="$(brew cask info $cask | sed -n '1p' | sed -n 's/^.*: \(.*\)$/\1/p')" |
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
| # -*- coding: utf-8 -*- | |
| import socket | |
| target_host = "127.0.0.1" | |
| target_port = 8080 | |
| # ソケットオブジェクトの作成 | |
| client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
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
| #include "include/apue.h" | |
| #include <dirent.h> | |
| int | |
| main(int argc, char *argv[]) | |
| { | |
| DIR *dp; | |
| struct dirent *dirp; | |
| if (argc != 2) |
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
| let mapleader = "," | |
| let scrollstep = 200 | |
| let hintcharacters = "asdgwertzcvbnml"; | |
| let homeurl = "https://www.yahoo.co.jp"; | |
| unmap "x" | |
| unmap "w" | |
| unmap "t" | |
| map "a" insertMode | |
| map "?" help | |
| map "r" toggleReader |
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
| #!/usr/bin/ruby | |
| Dir::chdir(File.expand_path("~/Dropbox/memo/markdown")) | |
| Dir::foreach('.') {|f| | |
| s = File.basename(f,'.*') | |
| system("pandoc -o ~/Dropbox/OneDrive/book/memo/#{s}.epub #{f}") | |
| } |
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
| /* coord.c | |
| $ gcc -o coord coord.c -W -Wall -Wextra -lm -ansi -pedantic | |
| $ ./coord | |
| (-0.000000,-0.707107) | |
| (-0.707107,0.000000) | |
| (0.000000,0.707107) | |
| (0.707107,-0.000000) | |
| */ | |
| #include <stdio.h> |
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
| PROGRAM = server | |
| OBJS = server.o | |
| SRCS = $(OBJS:%.o=%.c) | |
| CFLAGS = -g -Wall | |
| LDFLAGS = | |
| $(PROGRAM):$(OBJS) | |
| $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LDLIBS) |
NewerOlder