Protocolの記事用スクリプト
dein.vim and ddc.vim sample settings
  
    
      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 | |
| SECONDS=`date '+%s'` | |
| NAME='battery.magictrackpad' | |
| VALUE=`ioreg -c AppleDeviceManagementHIDEventService|grep BatteryPercent|awk -F'|' '{print $6}'|awk -F'=' '{print $2}'|xargs echo` | |
| echo -e "${NAME}\t${VALUE}\t${SECONDS}" | 
  
    
      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
    
  
  
    
  | import org.scalatest.PrivateMethodTester | |
| import org.scalatest.freespec.AnyFreeSpec | |
| class TestSpec extends AnyFreeSpec with PrivateMethodTester { | |
| "test" - { | |
| val t = new Test() | |
| "addPositiveNumber" in { | |
| assert(t.addPositiveNumber(10, 10) == 20) | |
| } | 
  
    
      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
    
  
  
    
  | nmap <Esc><Esc> :nohl | |
| nmap j gj | |
| nmap k gk | |
| nmap <DOWN> gj | |
| nmap <UP> gk | |
| imap jj <Esc> | |
| imap <C-a> <Esc>0i | |
| set clipboard=unnamed | 
  
    
      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
    
  
  
    
  | import argparse | |
| from typing import NamedTuple, Dict | |
| # 下記commandを前提にしてる | |
| # ping -s 16 -i 1 -c 86400 google.com | LANG=C xargs -I_ gdate +'%c _' > ping.txt | |
| def main(): | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('infile', type=argparse.FileType('r', encoding='utf-8')) | |
| parser.add_argument('--mode', type=str) | |
| parser.add_argument('--csv', action='store_true') | 
  
    
      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
    
  
  
    
  | import UIKit | |
| import PlaygroundSupport | |
| class MyViewController : UIPageViewController, UIPageViewControllerDataSource{ | |
| let first: UIViewController = FirstViewController() | |
| let second: UIViewController = SecondViewController() | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| self.view.backgroundColor = .white | 
ハマったはずなのに動いてる
すごい長い文章はfakerで作成
https://github.com/faker-ruby/faker/blob/master/doc/default/lorem.md
  
    
      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
    
  
  
    
  | import UIKit | |
| import PlaygroundSupport | |
| let width = 375 | |
| let height = 812 | |
| let view = UIView(frame: CGRect(x: 0, y: 0, width: width, height: height)) | |
| view.backgroundColor = .brown | |
| PlaygroundPage.current.liveView = view | |
| PlaygroundPage.current.needsIndefiniteExecution = true | 
NewerOlder