Skip to content

Instantly share code, notes, and snippets.

View hiroakit's full-sized avatar

hiroakit hiroakit

  • Japan
View GitHub Profile
@hiroakit
hiroakit / setup.sh
Last active July 22, 2018 22:32
hoge1
echo | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install python # python 3
pip3 install --upgrade pip
pip3 install ansible
cd ~/Documents/sources
git clone https://github.com/hiroakit/profile --recursive
cd profile
ansible-playbook -i hosts ./provisioning/osx.yml -K
@hiroakit
hiroakit / AirPlayFailedConsoleLog.txt
Created November 23, 2017 06:45
AirPlay failed fairplay content to AppleTV 2nd generation.
# Playback FairPlay content on iOS
# AirPlay sender: iOS 11.1.2
# AirPlay reciver: AppleTV 2nd gen
08:59:59.000000 +0900 AppleTV T:[Main] SYSTEM : LTAVPlayer: Playback failure error: Error Domain=AVFoundationErrorDomain Code=-11800 "操作を完了できませんでした" UserInfo=0x155f1e00 {NSLocalizedDescription=操作を完了できませんでした, NSUnderlyingError=0x168c3ff0 "The operation couldn\U2019t be completed. (NSOSStatusErrorDomain error 1718449215.)", NSLocalizedFailureReason=原因不明のエラーが起きました(1718449215)}
17:03:19.000000 +0900 AppleTV T:[Main] SYSTEM : LTAVPlayer: Returning event for error: Generic media load or playback failure event -11800
08:59:59.000000 +0900 AppleTV T:[Main] AirPlay : ### AirPlay player error: Error Domain=BackRowErrors Code=361 "The operation couldn\U2019t be completed. このコンテンツを読み込み中にエラーが発生しました。" UserInfo=0x157369a0 {NSLocalizedRecoverySuggestion=後でやり直してください。, NSUnderlyingError=0x1685bfb0 "操作を完了できませんでした", NSLocalizedFailureReason=このコンテンツを読み込み中にエラーが発生しました。}
17:03:19.000000 +0900 AppleTV T:[Main] AirPlay : ### AirPlay
@hiroakit
hiroakit / InsertionSort.swift
Created November 19, 2016 10:56
挿入ソート
// 挿入ソート
func insertionSort(items:inout [Int]) {
for i in (0 ... items.count - 1) {
var j = i
while j > 0 && items[j - 1] > items[j] {
swap(&items[j - 1], &items[j])
j -= 1
}
}
}
@hiroakit
hiroakit / QuickSort.swift
Last active November 19, 2016 10:57
クイックソート (Swift 3, Playground)
// クイックソート
func quickSort (numbers: inout [Int], left: inout Int, right: inout Int) -> Void {
var pivot : Int = 0
var l_hold : Int = 0
var r_hold : Int = 0
l_hold = left;
r_hold = right;
pivot = numbers[left];
@hiroakit
hiroakit / LeapYear.swift
Last active June 28, 2017 01:31
指定した年の範囲で閏年を算出 (Swift 3, Playground)
import UIKit
/// 閏年か判断する
///
/// - parameter year: 年
///
/// - returns: 閏年の場合にtrue、それ以外はfalse
func isLeapYear(year: Int) -> Bool {
// 4以上ではない場合は弾く
guard year >= 4 else {
@hiroakit
hiroakit / natron-xcode-debug-build.sh
Created October 2, 2016 12:49
Keyword: Natron, Xcode, Debug, build
cd libs/
cd qhttpserver/
xcodebuild -project src/qhttpserver.xcodeproj -target qhttpserver -configuration Debug
cd ../
cd hoedown/
xcodebuild -project hoedown.xcodeproj -target hoedown -configuration Debug
cd ../
@hiroakit
hiroakit / daily.py
Created May 21, 2016 06:46
python daily.py | pbcopy
"""
今月の週番号と日付をのテンプレートを生成するスクリプト
今月の週番号と日付をのテンプレートを生成する
"""
from datetime import *
def count_day_of_month(month, year=None):
"""
@hiroakit
hiroakit / rman-shader-mode.el
Created March 22, 2016 23:31
Emacs major mode for Renderman shader language.
;; License is GPL3
;; https://opensource.org/licenses/gpl-3.0.html
(require 'cc-mode)
;; TODO ファイルチェックをかける
(load "rman-shader-font")
(defvar rman-shader-mode-hook nil)
(defcustom rman-home "/Applications/Pixar/RenderManProServer-19.0"
@hiroakit
hiroakit / init.el
Last active December 20, 2015 05:17
(defconst hp-inits-dir (concat user-emacs-directory "inits"))
(defvar hp-melpa-url "http://melpa.milkbox.net/packages/")
(defvar hp-marmalade-url "http://marmalade-repo.org/packages/")
(defvar hp-use-package-list
'(
;; 以下に使用するパッケージを記述する
init-loader
scala-mode2
yasnippet
auto-complete
@hiroakit
hiroakit / PlayPolyPlane.py
Created August 2, 2015 11:57
create polyplane, move, scale, rotate
import maya.cmds as cmds
cmds.polyPlane(n='myPlane1', sx=1, sy=1, w=1.0, h=1.0)
# 他にもこういったコマンドでオブジェクトを生成できる
# cmds.polyCube( n='myCube1', sx=1, sy=1, sz=1, w=1.0, h=1.0)
# cmds.polySphere(n='mySphere1', sx=1, sy=1, r=1.0)
# cmds.polyCylinder(n='myCylinder1', sx=1, sy=1, sz=1, h=1.0)
# 生成したオブジェクトを移動、拡大、回転させる
cmds.move( 5, 0, 0, 'myPlane1', r=True )