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
    
  
  
    
  | extension Int { | |
| func toRoman(uppercase: Bool = true) -> String? { | |
| guard self > 0, self < 4000 else { return nil } | |
| let romanDigits = | |
| [["", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"], | |
| ["", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"], | |
| ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"], | |
| ["", "M", "MM", "MMM"]] | |
| let romanNumber = String(self).reversed().enumerated() | |
| .map { romanDigits[$0.offset][Int(String($0.element))!] } | 
  
    
      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
    
  
  
    
  | extension RandomAccessCollection { | |
| func sample() -> Element { | |
| let random = IndexDistance(arc4random_uniform(UInt32(self.count))) | |
| return self[index(startIndex, offsetBy: random)] | |
| } | |
| } | 
  
    
      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 pascalsTriangle = sequence(first: [1]) { | |
| zip([0] + $0, $0 + [0]).map(+) | |
| } | 
  
    
      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 triangularNumbers = sequence(state: (0,0)) { (state: inout (Int,Int)) -> Int in | |
| state = (state.0 + 1, state.1 + state.0 + 1 ) | |
| return state.1 | |
| } | 
  
    
      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
    
  
  
    
    | localeIdentifier | Description | |
|---|---|---|
| eu | Basque | |
| hr_BA | Croatian (Bosnia & Herzegovina) | |
| en_CM | English (Cameroon) | |
| en_BI | English (Burundi) | |
| en_AE | English (United Arab Emirates) | |
| rw_RW | Kinyarwanda (Rwanda) | |
| ast | Asturian | |
| en_SZ | English (Eswatini) | |
| he_IL | Hebrew (Israel) | 
  
    
      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
    
  
  
    
  | #!/bin/sh | |
| git bundle create ~/Backups/`basename $PWD`.git --all | 
  
    
      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
    
  
  
    
    | DEVICE TYPE | PRODUCT NAME | |
|---|---|---|
| iPhone1,1 | iPhone | |
| iPhone1,2 | iPhone 3G | |
| iPhone2,1 | iPhone 3GS | |
| iPhone3,1 | iPhone 4 (GSM) | |
| iPhone3,2 | iPhone 4 (GSM, Revision A) | |
| iPhone3,3 | iPhone 4 (CDMA) | |
| iPhone4,1 | iPhone 4S | |
| iPhone5,1 | iPhone 5 (A1428) | |
| iPhone5,2 | iPhone 5 (A1429) | 
  
    
      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
    
  
  
    
  | import Foundation | |
| extension String { | |
| var guessedNameFromEmail: String? { | |
| return self.split(separator: "@").first?.split(separator: ".").map { $0.capitalized(with: Locale.autoupdatingCurrent) }.joined(separator: " ") | |
| } | |
| } | 
      We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 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
    
  
  
    
  | Africa/Abidjan | |
| Africa/Accra | |
| Africa/Addis_Ababa | |
| Africa/Algiers | |
| Africa/Asmara | |
| Africa/Bamako | |
| Africa/Bangui | |
| Africa/Banjul | |
| Africa/Bissau | |
| Africa/Blantyre | 
  
    
      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
    
  
  
    
  | import MapKit | |
| import PlaygroundSupport | |
| let mapView = MKMapView() | |
| PlaygroundPage.current.liveView = mapView | |
| CLGeocoder().geocodeAddressString("1 Apple Park Way, Cupertino, CA") { | |
| (places, _) in | |
| guard let places = places?.map(MKPlacemark.init) else { return } | |
| mapView.showAnnotations(places, animated: true) |