Skip to content

Instantly share code, notes, and snippets.

View irshadpc's full-sized avatar
🎯
Focusing

IRSHAD PC irshadpc

🎯
Focusing
  • Hatio Innovations Private Limited
  • Kochi, India
  • X @_irshadpc
View GitHub Profile
@irshadpc
irshadpc / postgres-brew.md
Created November 20, 2020 06:15 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@irshadpc
irshadpc / .Title
Created February 15, 2018 15:18 — forked from congjf/.Title
Using MongoDB in golang with mgo
Using MongoDB in golang with mgo
#!/usr/bin/ruby
require 'xcodeproj'
# ============================================
# !!! I've released a ruby gem that does the same thing, but better.
# You can install it by running `gem install xcprovisioner` or
# `sudo gem install xcprovisioner` if it asks for sudo rights.
#
# For more info: https://github.com/thelvis4/XCProvisioner
@irshadpc
irshadpc / eliza.swift
Created June 3, 2017 16:07 — forked from hollance/eliza.swift
The classic ELIZA chat bot in Swift.
/*
Joseph Weizenbaum's classic ELIZA chat bot in Swift.
Based on the IBM PC BASIC program from CREATIVE COMPUTING by Patricia
Danielson and Paul Hashfield, and the Java adaptation by Jesper Juul.
Run this script from Terminal:
$ swift eliza.swift
Press Ctrl-C or Ctrl-D to quit. (Or type "shut up".)

Objective-C Coding Convention and Best Practices

Most of these guidelines are to match Apple's documentation and community-accepted best practices. Some are derived some personal preference. This document aims to set a standard way of doing things so everyone can do things the same way. If there is something you are not particularly fond of, it is encouraged to do it anyway to be consistent with everyone else.

This document is mainly targeted toward iOS development, but definitely applies to Mac as well.

Operators

NSString *foo = @"bar";
@irshadpc
irshadpc / CalculatorView.swift
Created February 28, 2017 11:45 — forked from natecook1000/CalculatorView.swift
An IBInspectable Calculator Construction Set
// CalculatorView.swift
// as seen in http://nshipster.com/ibinspectable-ibdesignable/
//
// (c) 2015 Nate Cook, licensed under the MIT license
/// The alignment for drawing an String inside a bounding rectangle.
enum NCStringAlignment {
case LeftTop
case CenterTop
case RightTop
@irshadpc
irshadpc / UIImagePickerController+cats.m
Created November 3, 2016 07:13 — forked from iandundas/UIImagePickerController+cats.m
How to detect iOS Photo library or Camera permissions (>iOS8)
//
// Created by Ian Dundas on 16/03/15.
//
#import "UIImagePickerController+cats.h"
#import <AVFoundation/AVFoundation.h>
#import "Photos/Photos.h"
/*
example usage:
@irshadpc
irshadpc / gist:f43e7cb2010fe5f4a7c84fd89bb57da4
Created October 22, 2016 15:42 — forked from adamgit/gist:3705459
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.82
#
# Latest Change:
# - MORE tweaks to get the iOS 10+ and 9- working
# - Support iOS 10+
# - Corrected typo for iOS 1-10+ (thanks @stuikomma)
@irshadpc
irshadpc / iOSMapKitFitAnnotations.m
Last active October 16, 2016 14:39 — forked from andrewgleave/iOSMapKitFitAnnotations.m
Zooms out a MKMapView to enclose all its annotations (inc. current location)
MKMapRect zoomRect = MKMapRectNull;
for (id <MKAnnotation> annotation in mapView.annotations) {
MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate);
MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0);
if (MKMapRectIsNull(zoomRect)) {
zoomRect = pointRect;
} else {
zoomRect = MKMapRectUnion(zoomRect, pointRect);
}
}
@irshadpc
irshadpc / gist:e729b494c85c1322499d5e54912ad8b9
Created September 28, 2016 06:13 — forked from steipete/ios-xcode-device-support.sh
Using iOS 10.1 devices with Xcode 8.0 (or: Xcode 7.3.1 and iOS 10 devices, same trick)
// The trick is to link the DeviceSupport folder from the beta to the stable version.
ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.1\ \(14B54\)/ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
// Then restart Xcode and recommect your devices. You will need to do that for every beta of iOS 10.1+/Xcode 8.
// sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)