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
| CC = "gcc" | |
| task :default => "fortune" | |
| desc "Make fortune" | |
| file "fortune" => "fortune.o" do |t| | |
| sh "#{CC} -o #{t.name} #{t.prerequisites.join(' ')}" | |
| end | |
| desc "Make fortune.o" |
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
| <!DOCTYPE html> | |
| <html lang="ja"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>カレーのレシピ</title> | |
| </head> | |
| <body> | |
| <article> | |
| <h1>カレーのレシピ</h1> | |
| <p> |
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
| // パラメータについて補足 | |
| // - move()でも良いはず | |
| // - X軸方向のみ揺らした | |
| // - 揺らす時間を短くした | |
| // - .shakeよりも.punchの方が好みだった | |
| LeanTween.moveLocal(mainCamera.gameObject, new Vector3(1,0,0), 0.1f).setEase(LeanTween.punch); |
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
| /// <summary> | |
| /// 3点を繋ぐベジェ曲線上の座標を返す | |
| /// </summary> | |
| /// <returns>座標</returns> | |
| /// <param name="start">始点</param> | |
| /// <param name="middle">中間点</param> | |
| /// <param name="end">終点</param> | |
| /// <param name="time">経過時間(0〜1)</param> | |
| public static Vector3 BezierCurveVector3(Vector3 start, Vector3 middle, Vector3 end, float time) { | |
| float invT = 1.0f - time; |
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
| let sum = values[from..<to].reduce(0, +) |
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
| enum Colors { | |
| case red | |
| case pink | |
| case yellow | |
| } | |
| extension CGColor { | |
| class func color(hex: UInt, alpha: CGFloat) -> CGColor { | |
| return CGColor.init(red: CGFloat((hex & 0xff0000) >> 16) / 255, | |
| green: CGFloat((hex & 0x00ff00) >> 8) / 255, |
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
| /* (メモ) | |
| * Bridging-Header.hに | |
| * #import <CommonCrypto/CommonDigest.h> | |
| * を書いておく。 | |
| */ | |
| func md5(_ string: String) -> String { | |
| var md5String = "" | |
| let digestLength = Int(CC_MD5_DIGEST_LENGTH) | |
| let md5Buffer = UnsafeMutablePointer<UInt8>.allocate(capacity: digestLength) |
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
| // httpの音楽ファイルを非同期で取得して再生する | |
| dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { () -> Void in | |
| let url = NSURL(string: "http://xxxxx.m4a") | |
| let data = NSData(contentsOfURL: url!) | |
| do { | |
| self.player = try AVAudioPlayer(data: data!) | |
| self.player.prepareToPlay() | |
| self.player.play() |
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
| float adjustOrthographicSize = originalOrthigraphicSize / camera.aspect / 2.0f; |
NewerOlder