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
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
@irshadpc
irshadpc / test_basic
Created July 24, 2017 13:51
Test basics
/*! * @class XCTestCase
* XCTestCase is a concrete subclass of XCTest that should be the override point for
* most developers creating tests for their projects. A test case subclass can have
* multiple test methods and supports setup and tear down that executes for every test
* method as well as class level setup and tear down.
*
* To define a test case:
*
* • Create a subclass of XCTestCase.
* • Implement -test methods.
#!/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".)
@irshadpc
irshadpc / SqlinjectionValid.m
Created May 31, 2017 08:06
Sql injection Valid Snippet
const char *sql = "SELECT username FROM users where uuid = ?";
sqlite3_prepare_v2(db, sql, -1, &selectUuid, NULL);
sqlite3_bind_int(selectUuid, 1, uid);
int status = sqlite3_step(selectUuid);
@irshadpc
irshadpc / SqlInjection.m
Created May 31, 2017 08:04
Sql Injection Vulnerable sample
NSString *uuid = [myConnection getUUID];
NSString *statement = [NSString StringWithFormat:@"SELECT username FROM users
where uuid = '%@'",uuid];
const char *sql = [statement UTF8String];
@irshadpc
irshadpc / Jaibroken.m
Created May 31, 2017 08:00
Jaibroken test
+(BOOL)isJailbroken{
#if !(TARGET_IPHONE_SIMULATOR)
if ([[NSFileManager defaultManager] fileExistsAtPath:@"/Applications/Cydia.app"]){
return YES;
}else if([[NSFileManager defaultManager] fileExistsAtPath:@"/Library/MobileSubstrate/MobileSubstrate.dylib"]){
return YES;
}else if([[NSFileManager defaultManager] fileExistsAtPath:@"/bin/bash"]){
return YES;

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";