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
@alokc83
alokc83 / interviewitems.MD
Created July 26, 2016 21:14 — forked from KWMalik/interviewitems.MD
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Googleโ€™s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Googleโ€™s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Googleโ€™s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@alokc83
alokc83 / Disable Alert Button.swift
Created May 2, 2018 19:26 — forked from TheCodedSelf/Disable Alert Button.swift
Disable Alert Controller button if Alert Controller text field is empty or whitespace
import UIKit
// Create an alert controller
let alertController = UIAlertController(title: "Alert", message: "Please enter text", preferredStyle: .alert)
// Create an OK Button
let okAction = UIAlertAction(title: "OK", style: .default) { (_) in
// Print "OK Tapped" to the screen when the user taps OK
print("OK Tapped")
}
@alokc83
alokc83 / Alert button disable
Created May 2, 2018 19:28
when need to disable the button on the alert viewController.
// another solution of disabling the button
//where alert is variable in class
override func textField(_ textField: UITextField,
shouldChangeCharactersIn range: NSRange,
replacementString string: String) -> Bool {
if range.location >= 1 { return true } // if we have one or more characters
guard let isTextFieldEmpty = textField.text?.isEmpty else { return true }
if !isTextFieldEmpty {
import Foundation
import UIKit
// Usage Examples
let shadowColor = Color.shadow.value
let shadowColorWithAlpha = Color.shadow.withAlpha(0.5)
let customColorWithAlpha = Color.custom(hexString: "#123edd", alpha: 0.25).value
enum Color {
@alokc83
alokc83 / arm-elf-gcc_on_osx.sh
Created September 11, 2018 11:47 — forked from steakunderscore/arm-elf-gcc_on_osx.sh
How I installed arm-elf-gcc on Mac OS X
#!/bin/bash
mkdir toolchain
cd toolchain
wget ftp://sources.redhat.com/pub/newlib/newlib-1.19.0.tar.gz
wget http://ftp.gnu.org/gnu/gdb/gdb-7.2.tar.gz
wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2
wget http://ftp.gnu.org/gnu/gcc/gcc-4.6.0/gcc-core-4.6.0.tar.bz2
@alokc83
alokc83 / CocoapodsRome
Created October 30, 2018 21:03
Podfile contents
#Cococapods content when using Cocoapods's Rome
#new tool that create fremeworks from Pods
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
plugin 'cocoapods-rome', { :pre_compile => Proc.new { |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
@alokc83
alokc83 / us-states-array
Last active May 9, 2019 16:13 — forked from iamjason/us-states-array
Swift US States Array
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",
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",
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?")
}
}
@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