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 / 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",
@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 / 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
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 / 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 {
@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 / 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 / fix_for_transport_security
Created March 28, 2016 03:04
fix for tansport security
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>raywenderlich.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
@alokc83
alokc83 / update_xcode_plugins
Last active September 4, 2015 13:25 — forked from neonichu/update_xcode_plugins
Update DVTPlugInCompatibilityUUIDs for installed plugins from Xcode 5.1 beta to final
#!/bin/sh
#ID='A16FF353-8441-459E-A50C-B071F53F51B7' # Xcode 6.2
ID='992275C1-432A-4CF7-B659-D84ED6D42D3F' # Xcode 6.3
PLIST_BUDDY=/usr/libexec/PlistBuddy
function add_compatibility() {
"$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \
"$1/Contents/Info.plist"
@alokc83
alokc83 / submodule_app_version_gen
Created May 6, 2015 04:45
submodule process for xcode version generator
create submodule thru sourceTree
https://github.com/alokc83/Xcode-build-and-version-generator.git
under supporting_files/
In build phase add script run paste follwoing code in there
#This is to run xcode-version-generator as submodule
${SRCROOT}/supporting_files/Xcode-build-and-version-generator/xcode-build-number-generator.sh
${SRCROOT}/supporting_files/Xcode-build-and-version-generator/xcode-versionString-generator.sh