Skip to content

Instantly share code, notes, and snippets.

View marciomeschini's full-sized avatar

Marco Meschini marciomeschini

View GitHub Profile
@zacwest
zacwest / ios-font-sizes.swift
Last active July 15, 2024 14:31
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
@orta
orta / _SQL.sql
Last active November 8, 2016 12:12
Top 300 Pods by Application Integrations
SELECT pods.name, stats_metrics.download_total, stats_metrics.download_week, stats_metrics.app_total, stats_metrics.app_week FROM stats_metrics JOIN pods ON stats_metrics.pod_id = pods.id ORDER BY app_total DESC LIMIT 300;
@i-like-robots
i-like-robots / data.js
Last active July 16, 2020 14:10
TfL API network data
exports.lines = {
"bakerloo": "Bakerloo",
"central": "Central",
"circle": "Circle",
"district": "District",
"hammersmith-city": "Hammersmith & City",
"jubilee": "Jubilee",
"metropolitan": "Metropolitan",
"northern": "Northern",
"piccadilly": "Piccadilly",
@oobrien
oobrien / README.md
Last active January 22, 2019 13:54
TfL lines and stations. Includes, Tube, DLR, Overground, Tramlink, Emirates Air Line and Crossrail. All as currently running/aligned, except Crossrail. Original data source: OpenStreetMap, which is Copyright OpenStreetMap contributors and available under the Open Database Licence.
@floriankugler
floriankugler / gist:6870499
Last active September 29, 2023 15:56
Mapping of NSURLConnection to NSURLSession delegate methods. Created by Mattt Thompson.
NSURLConnection | NSURLSession
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connectionShouldUseCredentialStorage: |
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler:
| N
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR
@zwaldowski
zwaldowski / UIImageCreateUsingBlock.m
Created May 30, 2013 18:29
Thread-safe UIImage-from-block function
//
// UIImageCreateUsingBlock.m
//
// Copyright (c) 2013 Zachary Waldowski.
// Licensed under MIT - Provided as-is.
//
#import <UIKit/UIKit.h>
#import <CoreGraphics/CoreGraphics.h>
@neebz
neebz / convertToLatLongFromEastings
Last active December 16, 2015 18:59
An Objective-C method to convert British Grid Coordinates (Easting and Northings) to Longitude and Latitude. Converted from Hannah Fry's Python method: http://hannahfry.co.uk/2012/02/01/converting-british-national-grid-to-latitude-and-longitude-ii/
#include <math.h>
#include "CLLocation.h" //requires Core Location Framework
- (CLLocationCoordinate2D)convertToLatLongFromEastings:(double)E andNorthings:(double *)N {
//E, N are the British national grid coordinates - eastings and northings
double a = 6377563.396; //The Airy 180 semi-major and semi-minor axes used for OSGB36 (m)
double b = 6356256.909;
double F0 = 0.9996012717;
@tonyarnold
tonyarnold / mr-save-patterns.md
Last active October 21, 2023 00:55
Common save patterns for use with MagicalRecord

Common Save Patterns

Standard background save

Assuming that you don't care which NSManagedObjectContext is used, and you just want to make some changes and save them in the background, use the following method. 90% of the time, this is what you'll want.

NSManagedObjectSubclass *myObject = [NSManagedObjectSubclass MR_findFirst];

[MagicalRecord saveWithBlock:^(NSManagedObjectContext *localContext) {
@jordelver
jordelver / gist:3073101
Created July 8, 2012 22:06
Set the Mac OS X SOCKS proxy on the command line

Set the Mac OS X SOCKS proxy on the command line

a.k.a. what to do when your ISP starts blocking sites :(

Set the SOCKS proxy to local SSH tunnel

networksetup -setsocksfirewallproxy "Ethernet" localhost 8080

To clear the domain and port