Skip to content

Instantly share code, notes, and snippets.

View mukeshthawani's full-sized avatar

Mukesh Thawani mukeshthawani

View GitHub Profile
@mukeshthawani
mukeshthawani / CSVParser.swift
Last active October 1, 2021 13:12
A simple CSV parser in Swift
/// Parses a csv string and returns a 2d array.
///
/// Size of the array will be equal to the number of rows.
/// And Size of the subarray will be equal to the
/// number of fields.
///
/// Note: Delimiter can be changed to a different character
/// like semicolon.
func parse(string: String, delimiter: Character = ",") -> [[String]]{
let rows = string.split(separator: "\n")
@mukeshthawani
mukeshthawani / CSVParser.swift
Created July 13, 2019 18:04
A simple CSV parser
/// Parses a csv string and returns a 2d array.
///
/// Size of the array will be equal to the number of rows.
/// And Size of the subarray will be equal to the
/// number of fields.
///
/// Note: Delimiter can be changed to a different character
/// like semicolon.
func parse(string: String, delimiter: Character = ",") -> [[String]]{
@mukeshthawani
mukeshthawani / iterm2.md
Created August 19, 2016 06:17
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [