Skip to content

Instantly share code, notes, and snippets.

Muhammad Adil itsaboutcode

View GitHub Profile
@itsaboutcode
itsaboutcode / create_app_without_storyboard.swift
Last active Mar 24, 2017
Start iOS application without storyboard
View create_app_without_storyboard.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.main.bounds)
window?.makeKeyAndVisible()
window?.rootViewController = UINavigationController(rootViewController: ViewController())
return true
View xcode-build-bump.sh
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@itsaboutcode
itsaboutcode / count_values
Created Nov 18, 2011
The keys in a dictionary are guaranteed to be unique, but the values are not. Write a function called count_values that takes a single dictionary as an argument and returns the number of distinct values it contains. For example,given the input {’red’:1,
View count_values
def count_values(dict):
values_count = {}
for key in dict:
values_count[dict[key]] = dict[key]
return len(values_count)
dict = {'red':1, 'green':1, 'blue':2}
print "Unique Values in Dictionary : %d" % count_values(dict)
View main.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World" << endl;
return 0;
}
@itsaboutcode
itsaboutcode / gist:721888
Created Nov 30, 2010
Find Min between subarray
View gist:721888
int get_min_range(int array[], int firstSubscript, int lastSubscript)
{
int smallestValue = array[firstSubscript];
int smalledIndex = firstSubscript;
for (int i = firstSubscript; i <= lastSubscript; i++)
{
if (array[firstSubscript] < smallestValue)
{
smallestValue = array[firstSubscript];
smalledIndex = firstSubscript;
You can’t perform that action at this time.