Skip to content

Instantly share code, notes, and snippets.

View byJeevan's full-sized avatar
💭
Working from Home 🏡

Jeevan byJeevan

💭
Working from Home 🏡
View GitHub Profile
@byJeevan
byJeevan / TJBinder+Model Update
Last active March 9, 2017 10:01
Gist of my solution for question posted in Stackoverflow https://goo.gl/oKsZAB
//****************TJBinder.h**************//
//
// BindProxy.h
// HelloBind
//
// Created by Janos Tolgyesi on 29/03/14.
// Copyright (c) 2014 Neosperience SpA. All rights reserved.
//
#import "UIView+TJBinder.h"
//Input array
var arr = ["31415926535897932384626433832795", "4", "66", "100"];
func comp(s1 : String, s2:String) -> Bool {
let length1 = s1.characters.count
let length2 = s2.characters.count
if length1 < length2 {
@byJeevan
byJeevan / Swift3.1 CheatSheet Plus
Last active May 31, 2020 12:52
Swift Cheat Sheet to save time.
/*
* Author : Jeevan Rao
* Date : 13/0/2017
* Swift : V3.1
*/
/* UI + UX Tricks */
//Selection style of table view cell (other than Default grey / Blue/ none)
let selectionColorView = UIView()
@byJeevan
byJeevan / NodeJS+MySql
Created May 10, 2018 04:20
Connecting NodeJS with MySQL
/* Sample code to connect MySQL DB in NodeJS
* Table name: user
* Test Result : Pass
* Pre-requesties : NodeJS installed with Express, MySql dependencies.
*/
var express = require("express")
var mysql = require('mysql')
var app = express()
import UIKit
import WebKit
class ViewController: UIViewController, WKNavigationDelegate {
@IBOutlet weak var demoWebView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
let url = URL(string: "https://ioscreator.com")!
//Custom class
class ExclusiveCollectionView : UIView, UICollectionViewDelegate, UICollectionViewDataSource {
@IBOutlet weak var exCollectionView: UICollectionView!
//Inits
class func instanceFromNib() -> ExclusiveCollectionView {
return UINib(nibName: "ExclusiveCollectionView", bundle: nil).instantiate(withOwner: nil, options: nil)[0] as! ExclusiveCollectionView
}
@byJeevan
byJeevan / ios-font-sizes.swift
Created July 25, 2018 05:02 — forked from zacwest/ios-font-sizes.swift
iOS default font sizes
let styles: [UIFontTextStyle] = [
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
for style in styles {
if #available(iOS 12.0, *) {
_yourOTPTextField.textContentType = .oneTimeCode
}
@byJeevan
byJeevan / lproj_string_keys.sh
Created December 18, 2018 12:58
This will print all the keys in the Localizable.strings file
#!/bin/sh
#Script will print all the keys in the Localization.string file from Xcode.
#First we have to copy the content and paste into a text file.
echo "***START***"
#Read line by line
while read line; do
#Convert string (by split with ;) to array
IFS='=' read -ra itemArray <<< "$line"
#Print first item in the array
for i in "${itemArray[0]}"; do
@byJeevan
byJeevan / ShellScriptPlayground.sh
Created December 18, 2018 13:00
This gist contains the collection of shell scripts for reference
#!/bin/sh
#*****Reading ******#
#From user
read -p "Enter Name: " userName
echo $userName
#From text file - line by line
while read line; do
echo $line