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
| use std::io::{self, Read, Write}; | |
| use std::fs::File; | |
| fn copy(reader: &mut Read, writer: &mut Write) { | |
| const BUFFER_SIZE: usize = 32 * 1024; | |
| let mut buf = [0u8; BUFFER_SIZE]; | |
| while let Ok(n) = reader.read(&mut buf) { | |
| if n == 0 { | |
| break; |
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/env sh | |
| # Scrap web pages | |
| # | |
| # Usage: | |
| # $ ./wscrap.sh https:xxx/xxx/ | |
| set -eu | |
| DEPTH=8 |
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
| g: https://www.google.com/search?q=%s Google | |
| wiki: https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s Wikipedia | |
| youtube: https://www.youtube.com/results?search_query=%s Youtube | |
| twitter: https://twitter.com/search?q=%s Twitter | |
| reddit: https://www.reddit.com/search?q=%s reddit | |
| hackernews: https://hn.algolia.com/?query=%s HackerNews | |
| github: https://github.com/search?q=%s GitHub | |
| qiita: https://qiita.com/search?q=%s Qiita | |
| stack: https://stackoverflow.com/search?q=%s Stack Overflow |
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 | |
| # sh build.sh ${target} | |
| set -eu | |
| if [ $# -eq 0 ]; then | |
| echo "target none, exit" | |
| exit 1 | |
| 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
| export SELFBUILD=$HOME/code/build | |
| export PATH=$HOME/local/bin:$PATH | |
| # go | |
| export GOROOT=$HOME/code/build/go | |
| export GOPATH=$HOME/.gopath | |
| export PATH=$SELFBUILD/go/bin:$PATH | |
| export PATH=$GOPATH/bin:$PATH | |
| # rust |
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
| # This file has been auto-generated by i3-config-wizard(1). | |
| # It will not be overwritten, so edit it as you like. | |
| # | |
| # Should you change your keyboard layout some time, delete | |
| # this file and re-run i3-config-wizard(1). | |
| # | |
| # i3 config file (v4) | |
| # | |
| # Please see http://i3wm.org/docs/userguide.html for a complete reference! |
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/bash | |
| # https://wiki.archlinuxjp.org/index.php/Xrandr#.E3.82.B9.E3.82.AF.E3.83.AA.E3.83.97.E3.83.88 | |
| MAIN="LVDS-1" | |
| VGA="VGA-1" | |
| DP="HDMI-1" | |
| VGA_DETECTED=false | |
| DP_DETECTED=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/bash | |
| # https://wiki.archlinuxjp.org/index.php/Xrandr#.E3.82.B9.E3.82.AF.E3.83.AA.E3.83.97.E3.83.88 | |
| MAIN="LVDS-1" | |
| EXT="VGA-1" | |
| if (xrandr | grep -q "$EXT disconnected"); then | |
| xrandr --output $MAIN --auto --output $EXT --off | |
| else |
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
| advanced_slice_patterns | |
| allow | |
| allow_internal_unstable | |
| asm | |
| associated_consts | |
| box_patterns | |
| box_syntax | |
| braced_empty_structs | |
| cfg | |
| cfg_attr |
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
| AsMut | |
| AsRef | |
| Box | |
| Clone | |
| Copy | |
| Debug | |
| Default | |
| DoubleEndedIterator | |
| Drop | |
| Eq |