Skip to content

Instantly share code, notes, and snippets.

View navaneet's full-sized avatar

navaneet sarma navaneet

View GitHub Profile
@DejanEnspyra
DejanEnspyra / Obfuscator.swift
Created May 31, 2017 17:51
Obfuscation of hard-coded security-sensitive strings.
//
// Obfuscator.swift
//
// Created by Dejan Atanasov on 2017-05-31.
//
import Foundation
class Obfuscator: AnyObject {
@RF-Nelson
RF-Nelson / Tutorial.md
Last active March 3, 2022 06:44
Using the Multipeer Connectivity Framework to Create the Open Source Selfie Stick iOS App

Using the iOS Multipeer Connectivity Framework to Create Open Source Selfie Stick

In this gist, I will discuss how I used the Multipeer Connectivity framework to create Open Source Selfie Stick. Open Source Selfie Stick is a free open-source iOS app that allows users to sync two devices over WiFi or Bluetooth and allows one to act as a remote control for the other's camera.

This tutorial assumes some knowledge of the Swift programming language and iOS development with Xcode.

Feel free to comment and point out any errors or improvements. If you'd like to help improve the app itself, make a fork from dev branch of the git repo. I plan on updating this document and explaining any newly added features or refactoring. As this gist w

@ericdke
ericdke / extractURLS.swift
Created January 21, 2016 18:38
SWIFT: Extract URLS from String
extension String {
func extractURLs() -> [NSURL] {
var urls : [NSURL] = []
do {
let detector = try NSDataDetector(types: NSTextCheckingType.Link.rawValue)
detector.enumerateMatchesInString(self,
options: [],
range: NSMakeRange(0, text.characters.count),
usingBlock: { (result, _, _) in
if let match = result, url = match.URL {
@xpqz
xpqz / gist:62b5267c250f04c30f9b
Created April 17, 2015 11:23
Cloudant helper class .m
//
// Cloudant.m
//
//
// Created by Stefan Kruger on 12/03/2015.
//
//
#import "Cloudant.h"
@fabiendevos
fabiendevos / method-tracing-android
Created March 17, 2015 22:59
Method tracing android
Debug.startMethodTracing("filename");
// code to trace
Debug.stopMethodTracing();
Then
adb pull /sdcard/filename.trace /tmp
traceview// code to trace
Debug.stopMethodTracing();
@AliSoftware
AliSoftware / struct_vs_inheritance.swift
Last active March 27, 2024 11:57
Swift, Struct & Inheritance: How to balance the will of using Struct & Value Types and the need for Inheritance?
// #!Swift-1.1
import Foundation
// MARK: - (1) classes
// Solution 1:
// - Use classes instead of struct
// Issue: Violate the concept of moving model to the value layer
// http://realm.io/news/andy-matuschak-controlling-complexity/
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active July 3, 2024 20:30
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@rob-murray
rob-murray / obj_c_constant_class_impl.c
Created February 1, 2013 13:27
An example of Objective C Global constant - shows class definition, implementation, import and usage
//Configuration.h
#import <Foundation/Foundation.h>
@interface Configuration : NSObject
extern NSString *const kRMAWebServiceURL;
extern const NSTimeInterval kRMTimeoutValue;
@andrewsardone
andrewsardone / gist:3751168
Created September 19, 2012 18:03
How does UIKit get pixels onto the screen?

UIView Drawing Model

-[UIView setNeedsDisplay]

You have some kind of custom UIView which implements some awesome drawing in -[UIView drawRect:]. In order to have UIKit draw it for you, you send the -[UIView setNeedsDisplay] to the view object to queue it up for drawing.

-[CALayer setNeedsDisplay]

     *------------*           *------------*

| | | |

@neonichu
neonichu / strip-lib.sh
Created January 23, 2012 12:35
Strip debug symbol from universal static libraries (tested for iOS only)
#!/bin/sh
#
## Strip debug symbol from universal static libraries
#
if [ -z "$1" ]
then
echo "$0 library"
exit 1