Skip to content

Instantly share code, notes, and snippets.

View ara-ta3's full-sized avatar

Arata Tanaka ara-ta3

View GitHub Profile
@ara-ta3
ara-ta3 / 0_dein.vim&ddc.vim.md
Last active April 11, 2024 07:08
dein.vim ddc.vim sample settings

dein.vim and ddc.vim sample settings

#!/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}"
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)
}
@ara-ta3
ara-ta3 / .obsidian.vimrc
Created May 6, 2021 01:13
利用中のobsidian.vimrc Obsidian Vimrc Support version: 0.2.4
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
@ara-ta3
ara-ta3 / _GitHookScripts.md
Last active February 25, 2021 07:03
git hook scripts

GitHookScripts

@ara-ta3
ara-ta3 / parse_ping.py
Created February 2, 2021 16:21
ping.py
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')
@ara-ta3
ara-ta3 / MyUIPageViewController.swift
Created October 1, 2020 06:38
_UIPageViewControllerでウォークスルーダミー
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
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

swift json decode

Run

swift --version
Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
Target: x86_64-apple-darwin19.5.0