Skip to content

Instantly share code, notes, and snippets.

View keitaito's full-sized avatar

Keita Ito keitaito

View GitHub Profile
@keitaito
keitaito / cocoapods-rainforest-rake-bootstrap-log
Created February 1, 2017 23:26
The log of Cocoapods/Rainforest `rake bootstrap` command
Last login: Sun Jan 29 14:33:59 on ttys003
Keitas-MacBook:~ keitaito$ cd /Users/keitaito/dev/Xcode/Repos/Clones/Rainforest
Keitas-MacBook:Rainforest keitaito$
Keitas-MacBook:Rainforest keitaito$
Keitas-MacBook:Rainforest keitaito$
Keitas-MacBook:Rainforest keitaito$ rake bootstrap
/Users/keitaito/.rbenv/versions/2.3.2/bin/bundle
--------------------------------------------------------------------------------
Fetching repositories list
//
// HackerRankChallengeSolution-Kangaroo.swift
// Kangaroo
//
// Created by Keita Ito on 1/29/17.
// Copyright © 2017 Keita Ito. All rights reserved.
//
// https://www.hackerrank.com/challenges/kangaroo
//
// main.swift
// DesignerPDFViewer
//
// Created by Keita Ito on 1/26/17.
// Copyright © 2017 Keita Ito. All rights reserved.
//
// The link to the challenge: https://www.hackerrank.com/challenges/designer-pdf-viewer
@keitaito
keitaito / HackerRankSolutionForTheLoveLetterMystery.swift
Last active January 19, 2017 07:43
Solution for The Love Letter Mystery in HackerRank
// https://www.hackerrank.com/challenges/the-love-letter-mystery
let t = Int(readLine()!)!
var inputs = [String]()
for i in 0..<t {
let string = readLine()!
inputs.append(string)
}
// Add Foundation import to be able to use NSDate class below.
import Foundation
print("Hello, world!")
// There is always one argument passed, which is the name of the program,
// that is the file name.
if CommandLine.argc < 2 {
print("No arguments are passed.")
let firstArgument = CommandLine.arguments[0]
// Add Foundation import to be able to use NSDate class below.
import Foundation
print("Hello, world!")
// There is always one argument passed, which is the name of the program,
// that is the file name.
if CommandLine.argc < 2 {
print("No arguments are passed.")
let firstArgument = CommandLine.arguments[0]
// Add Foundation import to be able to use NSDate class below.
import Foundation
print("Hello, world!")
// There is always one argument passed, which is the name of the program,
// that is the file name.
if CommandLine.argc < 2 {
print("No arguments are passed.")
let firstArgument = CommandLine.arguments[0]
print("Hello, world!")
// There is always one argument passed, which is the name of the program,
// that is the file name.
if CommandLine.argc < 2 {
print("No arguments are passed.")
let firstArgument = CommandLine.arguments[0]
print(firstArgument)
} else {
print("Arguments are passed.")
print("Hello, world!")
// Updated to Swift 3 syntax.
func mapScalarValues(s: String, f: (UInt32) -> UInt32) -> String {
let scalars = Array(s.unicodeScalars)
let encrypted = scalars.map { x in
Character(UnicodeScalar(f(x.value))!)
}
return String(encrypted)
}