Skip to content

Instantly share code, notes, and snippets.

View patelrohan's full-sized avatar
🤓

Rohan Patel patelrohan

🤓
  • Dynamic Island
View GitHub Profile
@patelrohan
patelrohan / bootstrap-breakpoint.css
Created April 12, 2023 05:11 — forked from WebDevSimplified/bootstrap-breakpoint.css
This stylesheet adds text describing the current Bootstrap Breakpoint in the top right corner of the screen.
body {
margin-top: 40px; /* This margin just makes the text easier to read. You can remove it if you want since it can mess with your other styles. */
}
body::before {
content: "XS";
color: red;
font-size: 2rem;
font-weight: bold;
position: fixed;
@patelrohan
patelrohan / FirstUniqueInt.m
Created November 10, 2017 07:56
Find first unique integer from an array
//
// main.m
// Algorithm
//
// Created by Rohan Patel on 11/10/17.
// Copyright © 2017 Rohan Patel. All rights reserved.
//
/*
Note: I found two mistakes in the proposed solution during the interview:
@patelrohan
patelrohan / Singleton
Created June 20, 2014 06:50
Singleton
#import <Foundation/Foundation.h>
#import<AddressBook/AddressBook.h>
@interface Singleton : NSObject
{
//int myInt;
}
@property (nonatomic) ABRecordRef personGlobal; //Global Addressbook Person Object.
@property (nonatomic) int myInt;
import java.util.ArrayList;
import java.util.Scanner;
public class Quad {
public static void main(String args[])
{
ArrayList resultArray= new ArrayList();
ArrayList elementArray= new ArrayList();
@patelrohan
patelrohan / gist:5153535
Last active December 14, 2015 21:49
issue
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
InvProductDetailViewController *idvc = [[InvProductDetailViewController alloc] initWithNibName:@"InvProductDetailViewController" bundle:nil];
[self.navigationController pushViewController:idvc animated:YES];
[idvc release]; //Zombie shows issue here. Commenting this line solved the issue but generated memory leak.
}
@patelrohan
patelrohan / gist:4574559
Created January 19, 2013 19:27
From this ViewController.m I want to invoke updateTable in LeftViewController.m
//---------------------------------------ViewController.h---------------------------------------
@protocol LeftViewControllerProtocol <NSObject>
-(void)updateTable;
@end
@interface ViewController : UIViewController <CLLocationManagerDelegate,ViewControllerDelegate>
@patelrohan
patelrohan / gist:4482451
Last active December 10, 2015 19:38
Distance calculation using Locationamanger
-(void)findCurrentLocation
{
if(nil==self.locationManager)
{
self.locationManager= [[[CLLocationManager alloc]init]autorelease];
}
locationManager.delegate=self;
@patelrohan
patelrohan / gist:4473361
Last active December 10, 2015 18:18
Singleton.m
#import "SingletonClass.h"
#import "ViewController.h"
@implementation SingletonClass
@synthesize locationManager;
@synthesize startLocation,stopLocation;
@synthesize testStr;
//static SingletonClass *sharedManager = nil;
@patelrohan
patelrohan / gist:4358517
Created December 22, 2012 11:26
Add for loop to make searchbar color same as navgation controller
searchBar.delegate = self;
searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 200.0, 44.0)];
searchBar.placeholder = @"Search Files";
searchBar.userInteractionEnabled=YES;
//searchBar.tintColor=[UIColor clearColor];
//Mark : For Loop for Searchbar Color change
for (UIView *view in self.searchBar.subviews)
@patelrohan
patelrohan / gist:4352890
Last active August 21, 2018 20:05
Put UISearchBar in Navigation Controller
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"Literature";
if (searchText.length > 0) {
[searchBar setShowsCancelButton:YES];
searchBar.text = searchText;
[self searchLiteraturesWithName:searchText];
}
[self.navigationController.navigationBar setTintColor:[UIColor primaryBarColor]];