Skip to content

Instantly share code, notes, and snippets.

View tokorom's full-sized avatar

tokorom tokorom

View GitHub Profile
import AVKit
import GroupActivities
import UIKit
class ViewController: AVPlayerViewController {
private var groupSession: GroupSession<MovieWatchingActivity>?
override func viewDidLoad() {
super.viewDidLoad()
@tokorom
tokorom / DeviceTokenDataToDeviceTokenString.swift
Created July 6, 2020 02:45
Code to convert the data of a device token into a string, which was introduced in the WWDC20 session
let tokenComponents = token.map { data in String(format: "%02.2hhx", data) }
let deviceTokenString = tokenComponents.joined()
let itemHeight: CGFloat = 96
let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .estimated(itemHeight))
let item = NSCollectionLayoutItem(layoutSize: itemSize)
let group = NSCollectionLayoutGroup.horizontal(layoutSize: itemSize, subitem: item, count: 1)
let section = NSCollectionLayoutSection(group: group)
section.interGroupSpacing = 16
section.contentInsets = NSDirectionalEdgeInsets(top: 20, leading: 20, bottom: 20, trailing: 20)
return UICollectionViewCompositionalLayout(section: section)
@tokorom
tokorom / .gitignore
Last active May 2, 2020 13:43
!*.xcodeproj/xcshareddata を入れないとSchemeがShareされない
# hidden/temp files
.DS_Store
*.swp
*~.nib
*.bk
temp.plist
# Build dir
build/
let segue = UIStoryboardSegue(identifier: nil, source: self, destination: viewController) { [unowned self] () in
self.present(viewController, animated: true)
}
segue.perform()
let destination = UIViewController()
destination.view.backgroundColor = UIColor.red
let segue = FooSegue(identifier: nil, source: self, destination: destination)
segue.perform()
class EventsController < ApplicationController
before_action :set_event, only: [:show, :edit, :update, :destroy]
# GET /events
def index
@events = Event.all
end
# GET /events/1
def show
binding.pry
p 'test'
docker-compose run --service-ports app shell
rails s -b 0.0.0.0
@tokorom
tokorom / package.json
Last active December 7, 2016 06:49
package.json for swift package development
{
"config": {
"exe": "hoge"
},
"scripts": {
"build": "swift build",
"run": "./.build/debug/$npm_package_config_exe",
"build-and-run": "npm run build; npm run run",
"watch": "watch 'npm run build-and-run' ./Sources",
"start": "npm run watch"

開始手順

  1. docker-machineを確認
docker-machine ls
  1. Stoppedならdocker-machineを起動