Skip to content

Instantly share code, notes, and snippets.

View Isuru-Nanayakkara's full-sized avatar

Isuru Nanayakkara Isuru-Nanayakkara

  • Colombo, Sri Lanka
View GitHub Profile
@IsaacXen
IsaacXen / README.md
Last active May 17, 2024 10:56
(Almost) Every WWDC videos download links for aria2c.
@staltz
staltz / introrx.md
Last active May 17, 2024 07:59
The introduction to Reactive Programming you've been missing
@andrewgleave
andrewgleave / iOSMapKitFitAnnotations.m
Last active May 17, 2024 02:07
Zooms out a MKMapView to enclose all its annotations (inc. current location)
MKMapRect zoomRect = MKMapRectNull;
for (id <MKAnnotation> annotation in mapView.annotations) {
MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate);
MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0);
if (MKMapRectIsNull(zoomRect)) {
zoomRect = pointRect;
} else {
zoomRect = MKMapRectUnion(zoomRect, pointRect);
}
}
@cprovatas
cprovatas / Data+PrettyPrint.swift
Created May 23, 2018 15:52
Pretty print JSON string from Data in Swift 4.1 (especially useful printing to Xcode console)
import Foundation
extension Data {
var prettyPrintedJSONString: NSString? { /// NSString gives us a nice sanitized debugDescription
guard let object = try? JSONSerialization.jsonObject(with: self, options: []),
let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]),
let prettyPrintedString = NSString(data: data, encoding: String.Encoding.utf8.rawValue) else { return nil }
return prettyPrintedString
}
@MelbourneDeveloper
MelbourneDeveloper / flutterhealthcheck.md
Last active May 6, 2024 18:14
Flutter App Health Check

✔️ Widget Tests

Widget tests should cover the main use cases in your app. They test the UI and logic, but don't need to be granular unit tests. The important things are

  • You have good code coverage. 90% + is usually a good indicator the main use cases are covered
  • The tests cover the full app - not isolated components
  • Tests run as integration tests on the target platforms

✔️ State Management

Most state management approaches are fine. The important thing are:

  • The codebase chooses one and uses it consistently
  • There is a separation of concerns (presentation, business, and infrastructure).
@tracker1
tracker1 / 01-directory-structure.md
Last active May 4, 2024 19:55
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@Fatimas1997
Fatimas1997 / intercept-HTTP-requests-from-Flutter-apps.md
Created October 9, 2023 21:31
How to intercept HTTP traffic from a Flutter application with Burp (Android and iOS)

Intercepting traffic on Android and iOS Flutter applications

I recently stumbled upon an application developed with Flutter, and since it was my first time seeing it, I surprisingly couldn't intercept its requests. After some digging on google, I created this tutorial with the steps that personally worked for me and I wanted to share them in hope to help someone else. Note that the applications that I tested didn't have certificate pinning implemented. I'll update this file once I get to test an application that has it (if I'll be able to bypass it 😃 ).
To simplify the explanation I refer to the machine that hosts Burp as Kali, but you can use whatever linux machine you want.

Android:

There are 2 ways to intercept HTTP connections from a Flutter application installed on an Android device (I'm sure there are more but these are the ones I know). Intercepting requests by changing the proxy settings of the device, through the classic settings of Android, doesn't work in this case, since Flutter applic

@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@MelbourneDeveloper
MelbourneDeveloper / Stuff That Software Developers Do.md
Last active April 15, 2024 12:30
Stuff That Software Developers Do

Stuff That Software Developers Do

This is a list of stuff that the average software developer does from week to week

Coding

  • Code design
  • Refactoring
  • Algorithms
  • Profiling
  • Code reviews
  • Building frameworks
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos