Skip to content

Instantly share code, notes, and snippets.

View alokc83's full-sized avatar
🚀
Open to new opportunities

Alok Choudhary alokc83

🚀
Open to new opportunities
View GitHub Profile
### Keybase proof
I hereby claim:
* I am alokc83 on github.
* I am stakingnode (https://keybase.io/stakingnode) on keybase.
* I have a public key ASCHeGGWDt7hK-nlzuT8Ojo3O5pZOW8-uSclPjv_-7DIrwo
To claim this, I am signing this object:
<!-- Add this file to: ~/Library/Developer/Xcode/UserData/FontAndColorThemes -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0.901961 0.831373 0.639216 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>SFMono-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
@alokc83
alokc83 / Count lines of code in Xcode project
Created February 26, 2020 06:31 — forked from Tokuriku/Count lines of code in Xcode project
Count lines of code in SWIFT Xcode project
1. Open Terminal
2. cd to your Xcode project
3. Execute the following when inside your target project:
find . -name "*.swift" -print0 | xargs -0 wc -l
@alokc83
alokc83 / enable-xcode-debug-menu.sh
Created February 25, 2020 17:33 — forked from dsabanin/enable-xcode-debug-menu.sh
Enable internal Xcode debug menu in Xcode 11
defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES
sudo mkdir -p /Applications/Xcode.app/Contents/Developer/AppleInternal/Library/Xcode
sudo touch /Applications/Xcode.app/Contents/Developer/AppleInternal/Library/Xcode/AppleInternal.plist
# Don't forget to restart Xcode
@alokc83
alokc83 / lsby-hello-world.swift
Last active January 31, 2020 21:40
lsby1-hello-world.swift
import Foundation
var str = "Hello, playground"
// /////////////////////////////////////////////////////////
// For Loops 2
// /////////////////////////////////////////////////////////
import Foundation
/// Use of .some in For loop with `for case let`
func usingForCaseLet() {
import Foundation
import UIKit
func unwrappingWithOprator(input: String? = nil) {
print("\n-----------Result for function \(#function) -----------")
let name: String? = input
let unwrappedName = name ?? "Unknown Entity"
print(unwrappedName)
// or you can
print(name ?? "Unknown Entity")
@alokc83
alokc83 / acdotcom-st-for-loops.swift
Created January 20, 2020 14:35
Show various way to use for loops
import Foundation
let ironman = (name: "Tony", password: "M#n")
let spiderman = (name: "Peter", password: "Spid3r")
let deadpool = (name: "Wade", password: "w1lls0n")
let users = [ironman, spiderman, deadpool]
func firstLoop() {
//simply printing name
import Foundation
func simpleSwitch() {
let name = "Ironman"
switch name {
case "Spiderman": print("Hello, Peter Parker")
case "Ironman": print("Hello, Tony Stark")
default: print("who are you?")
}
}
let states-short-long = [ "AK - Alaska",
"AL - Alabama",
"AR - Arkansas",
"AS - American Samoa",
"AZ - Arizona",
"CA - California",
"CO - Colorado",
"CT - Connecticut",
"DC - District of Columbia",
"DE - Delaware",