Skip to content

Instantly share code, notes, and snippets.

Avatar

kobaken kobaken0029

View GitHub Profile
@kobaken0029
kobaken0029 / build_finish_failure.sh
Last active Sep 10, 2018
ビルド時間計測スクリプト
View build_finish_failure.sh
#!/bin/bash
BUILD_DIR_PATH=~/Documents/Build
START_FILE_PATH=$BUILD_DIR_PATH/_start.txt
BUILD_FAILURE_DIR_PATH=$BUILD_DIR_PATH/logs/failure
#前回のビルド実行開始時間を取得
START=`cat $START_FILE_PATH`
# ビルド開始記録を削除
@kobaken0029
kobaken0029 / MyPlayground.playground
Created Dec 2, 2017
XcodeのPlayground上で画像を読み込みUIImageViewで表示
View MyPlayground.playground
import UIKit
import PlaygroundSupport
let image = UIImage(named: "girl")
let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 320, height: 320))
imageView.image = image
imageView.contentMode = .scaleAspectFill
// Live Viewに表示させたいViewを渡す
@kobaken0029
kobaken0029 / README.md
Created Sep 5, 2017
Template for README.md
View README.md

Name

Overview

Description

Demo

VS.

@kobaken0029
kobaken0029 / fizzbuzz.es6
Created May 23, 2016
ES6でワンライナーfizzbuzz
View fizzbuzz.es6
[...Array(101).keys()].slice(1,101).forEach(i=>console.log((i%3?'':'fizz')+(i%5?'':'buzz')||i))
@kobaken0029
kobaken0029 / fizzbuzz.java
Created May 23, 2016
Javaでワンライナーfizzbuzz
View fizzbuzz.java
IntStream.range(1,101).mapToObj(i->(i%15==0?"FizzBuzz":i%5==0?"Buzz":i%3==0?"Fizz":i)).forEach(System.out::println);
@kobaken0029
kobaken0029 / fizzbuzz.js
Created Apr 22, 2016
JavaScriptでワンライナーfizzbuzz
View fizzbuzz.js
for(var i=1;i<101;i++) console.log((i%3?'':'fizz')+(i%5?'':'buzz')||i);
@kobaken0029
kobaken0029 / fizzbuzz.php
Last active Apr 22, 2016
phpでワンライナーfizzbuzz
View fizzbuzz.php
<?php foreach(range(1,100)as$i){echo($i%5&&$i%3?$i:'').($i%5?'':'fizz').($i%3?'':'buzz')."\n";}
@kobaken0029
kobaken0029 / fizzbuzz.kt
Created Apr 21, 2016
kotlinでワンライナーfizzbuzz
View fizzbuzz.kt
(1..100).map{println(when{it%15==0->{"fizzbuzz"}it%5==0->{"buzz"}it%3==0->{"fizz"}else->it})}
@kobaken0029
kobaken0029 / fizzbuzz.rb
Created Apr 21, 2016
rubyでワンライナーfizzbuzz
View fizzbuzz.rb
1.upto(100){|i|puts i%15==0?'fizzbuzz':i%5==0?'buzz':i%3==0?'fizz':i}
@kobaken0029
kobaken0029 / fizzbuzz.pl
Created Apr 21, 2016
perlでワンライナーfizzbuzz
View fizzbuzz.pl
map{print(($_%15==0?'fizzbuzz':$_%3==0?'fizz':$_%5==0?'buzz':$_)."\n")}1..100;