Skip to content

Instantly share code, notes, and snippets.

In love with JS stack.

Jay Mayu mayooresan

In love with JS stack.
View GitHub Profile
View gist:6be63604a19413e309eb
//new navigation code for apple navigation
CLLocationCoordinate2D coords = CLLocationCoordinate2DMake(self.m_lattitutef,self.m_longitutef);
NSLog(@"%f - %f", self.m_longitutef, self.m_lattitutef);
MKPlacemark *place = [[MKPlacemark alloc]
initWithCoordinate:coords addressDictionary:nil];
MKMapItem *mapItem = [[MKMapItem alloc]initWithPlacemark:place];
//current location
MKMapItem *mapItem2 = [MKMapItem mapItemForCurrentLocation];
mayooresan / Swift 3 - Appdelegate NavigationBar Customisation
Last active Oct 17, 2016
This is a sample that can be reused to change the font / colours / tint of your navigation bar.
View Swift 3 - Appdelegate NavigationBar Customisation
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
// Override point for customization after application launch.
UIApplication.shared.statusBarStyle = UIStatusBarStyle.lightContent
let navigationController : UINavigationController = self.window?.rootViewController as! UINavigationController
// Change the navigation bar background color to blue.
navigationController.navigationBar.barTintColor = UIColor(red: 243/255, green: 129/255, blue: 37/255, alpha: 0)
mayooresan / gist:01747a21d1582029adf1
Last active Jan 11, 2017
Laravel 5.2 - Jay's notes
View gist:01747a21d1582029adf1

Laraval Commands

php artisan - common comands
php artisan tinker - playground

Create a controller :

php artisan make:controller ArticlesController

Generic UI Stuff

Creating and adding multiple bar buttons to navigation bar

let addBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(ViewController.addPerson(_:)))
let filterBarButtonItem = UIBarButtonItem(title: "Filter", style: .plain, target: self, action: #selector(ViewController.filter))

navigationItem.rightBarButtonItems = [addBarButtonItem, filterBarButtonItem]

creating a actionsheet style alert controller without using third party apps

View cat-protocol-methods.swift
class Cat : Animal{
func run() {
print("Cat is running now")
func stop() {
print("Cat has stopped now")
View Dog.swift
class Dog : Animal{
func run() {
print("Dog is running now")
func stop() {
print("Dog has stopped now")
View multiple-delegates.swift
protocol Animal{
func run()
func stop()
protocol Eye{
func closeEyesAndSleep()
func openEyesAndLookAround()