Skip to content

Instantly share code, notes, and snippets.

View ashikahmad's full-sized avatar

Ashik Uddin Ahmad ashikahmad

View GitHub Profile
@ashikahmad
ashikahmad / BetterNSLog.md
Last active December 11, 2015 20:58
A quick replacement to NSLog in your Obj C project

#Better NSLog A quick replacement to NSLog in your Obj C project

This will need no extra effort at all and changes the way you see your logs in debug area.

###How it looks in Debug Area:

Before:

2013-01-29 15:46:24.076 Looptivity[76673:c07] ----2013-01-28 19:02:47 +0000
//
// KSDIdlingWindow.h
//
// Created by Brian King on 4/13/10.
// Copyright 2010 King Software Designs. All rights reserved.
//
// Based off:
// http://stackoverflow.com/questions/273450/iphone-detecting-user-inactivity-idle-time-since-last-screen-touch
//
@ashikahmad
ashikahmad / pretty_prompt
Last active December 29, 2015 11:09
A pretty prompt for terminal or iTerm. (Inspired by this link: https://github.com/Lokaltog/powerline). Check attached images to see what to achieve. Check pretty_prompt_HowTo.md for instructions.
# Install and use menlo font-patch from: https://gist.github.com/qrush/1595572
# Setting GIT prompt
b_black=`tput setab 0`
b_red=`tput setab 9`
b_green=`tput setab 2`
b_cyan=`tput setab 14`
b_white=`tput setab 15`
f_black=`tput setaf 0`
//
// category_file.h
@interface SomeClass (Private)
@property (nonatomic, assign) id newProperty;
@end
NSString * const kNewPropertyKey = @"kNewPropertyKey";
@implementation SomeClass (Private)
@dynamic newProperty;
- (void)setNewProperty:(id)aObject
@ashikahmad
ashikahmad / Interesting Git Repos.md
Last active August 29, 2015 14:06
All GitHub (and possibly other git) repos that I may like to remember.

Useful Codes

@ashikahmad
ashikahmad / ShellNinja.sh
Last active August 29, 2015 14:07
Some awesome tips and resources for smartly using shell. This are collected from here and there on internet. Basically it is for my own future reference as I forgot all the times :p
# ------------[ Shortcuts ]--------------
# tab => Complete argument
# ctrl+w => Delete last (w)ord
# ctrl+u => Delete whole line
# ctrl+k => Delete from cursor to end of line (kill)
# ctrl+a => Cursor back to start of line
# ctrl+l => C(l)ear Screen
# ctrl+r => Sea(r)ch for previous command
# ---------------------------------------
@ashikahmad
ashikahmad / remove_unexpected_repo_from_xcode_source_control.md
Last active June 17, 2022 18:55
Removing unexpected repository from XCode source control

Here are the steps that should work for you:

This steps are copied from pocketlogic's answer at StackOverflow

  1. Quit Xcode, and make a backup of your project file ( projectName.xcodeproj ).
  2. In Finder, right-click on your project file and select Show Package Contents.
  3. Right-click on the project.xcworkspace file, and select Show Package Contents.
  4. In the folder named xcshareddata, there is a file with the extension .xccheckout (it should have the same name as your main project file, but with the .xccheckout extension). Open the .xccheckout file in your favorite plain-text editor - this is a plist.
  5. Find the IDESourceControlProjectWCConfigurations key, and look for the <dict> that has the name of the repository that you want to remove. In the same \ there is a key IDESourceControlWCCIdentifierKey whose value contains an i
@ashikahmad
ashikahmad / DayOrdinal.swift
Last active February 4, 2019 16:29
A Playground (swift code) to show a workaround of day ordinal (Ex: `1st` February) with DateFormatter
//----------------------------------------------------------
// NOTE:
// Paste this files content to a playground to experiment
//----------------------------------------------------------
import UIKit
func dateStr(_ format: String, date: Date = Date())-> String {
@ashikahmad
ashikahmad / FontList.swift
Last active July 27, 2017 20:28
Prints all available fonts in console. Try pasting this code in Xcode Playground.
import UIKit
/*
Prints all available fonts in console. Try pasting this code in Xcode Playground
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
┌───────────┐
│ All Fonts │
└┬──────────┘
├─┬─⦿ Family with fonts
@ashikahmad
ashikahmad / SafeOptional.swift
Created July 31, 2017 09:22
Using optionals easily: save you from frequent coelsing
//
// SafeOptional.swift
// TodoMVVM
//
// Created by Ashik uddin Ahmad on 7/20/17.
// Copyright © 2017 Ashik uddin Ahmad. All rights reserved.
//
import Foundation