Skip to content

Instantly share code, notes, and snippets.

View A1iAshoor's full-sized avatar
🚀

Ali Ashoor A1iAshoor

🚀
View GitHub Profile
@A1iAshoor
A1iAshoor / CsvUtils.cs
Created July 7, 2021 11:25 — forked from riyadparvez/CsvUtils.cs
DataTable to CSV extension methods. Export to CSV file, CSV string
public static class CSV
{
public static string ToCSV(this DataTable table)
{
var columnHeaders = (from DataColumn x in table.Columns
select x.ColumnName).ToArray();
StringBuilder builder = new StringBuilder(String.Join(",", columnHeaders));
builder.Append("\n");
foreach (DataRow row in table.Rows)
@A1iAshoor
A1iAshoor / gist:12b2673c94ed13a788e7e36c411ed4e7
Last active August 20, 2016 06:34 — forked from lostincode/gist:909b72f96bfbf8d7f956
Google Analytics Swift Extension
extension UIViewController {
func trackScreen(name: String) {
let tracker = GAI.sharedInstance().defaultTracker
tracker.set(kGAIScreenName, value: name)
let builder = GAIDictionaryBuilder.createScreenView()
tracker.send(builder.build() as [NSObject : AnyObject])
}
func trackEvent(category: String, action: String, label: String, value: NSNumber?) {