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)

Keybase proof

I hereby claim:

  • I am a1iashoor on github.
  • I am ashcrypt (https://keybase.io/ashcrypt) on keybase.
  • I have a public key ASAEvTctxhjvvFxj1qFD8Pd-TZAb8_SSbgTOrHoT2v5w_go

To claim this, I am signing this object:

To show hidden files and folders in Finder, open a terminal window and type this:
defaults write com.apple.finder AppleShowAllFiles TRUE
(the above sentence is all in one line), press return, and then type:
killall Finder (and press return)
Finder will relaunch and you will be able to see hidden files and folders.
To revert (hide hidden items), type this in terminal:
defaults write com.apple.finder AppleShowAllFiles FALSE
@A1iAshoor
A1iAshoor / gist:2b6b7bd99f6b17e0ed2765bd231dcf2a
Created November 6, 2017 11:38
Kill server pids running on port X
kill -9 $(lsof -i tcp:3000 -t)
@A1iAshoor
A1iAshoor / Locale.swift
Created August 20, 2016 13:29
Global Locale Language Manager in Swift 2.3 [Supports Localized Storyboards]
class Locale {
static var language: String {
set{
defaults.setObject(newValue, forKey: "currentLanguage")
defaults.synchronize()
}
get{
if let currentLanguage: String = defaults.stringForKey("currentLanguage"){
return currentLanguage
}
@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?) {
@A1iAshoor
A1iAshoor / omniauth_controller.rb
Created August 24, 2015 22:59
Rails + Devise + Facebook Login API + iOS Facebook SDK | Controller
class Api::V1::OmniauthController < ApplicationController
skip_before_filter :verify_authenticity_token, :if => Proc.new { |c| c.request.format == 'application/json' }
before_filter :authenticate_user!, :except => [:create, :failure]
def new
end
def create
params[:access_token] = decrypt(params[:access_token])
auth_access_token = params[:access_token]