Skip to content

Instantly share code, notes, and snippets.

View maxkramer's full-sized avatar

Max Kramer maxkramer

View GitHub Profile
@plentz
plentz / nginx.conf
Last active July 27, 2024 16:11
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@lukeredpath
lukeredpath / ExampleClass.m
Created June 30, 2011 22:18
Macro for creating your "shared instance" using GCD
@implementation MySharedThing
+ (id)sharedInstance
{
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{
return [[self alloc] init];
});
}
@end
@zssz
zssz / MKMapView+PointScroll.m
Created November 26, 2010 21:22
Scrolls the map the point amount specified in offset and optionally animates this.
- (void)scrollWithOffset:(CGSize)offset animated:(BOOL)animated
{
MKMapPoint centerMapPoint = MKMapPointForCoordinate(self.centerCoordinate);
CGPoint centerPoint = [self convertCoordinate:self.centerCoordinate toPointToView:self];
CGPoint destinationPoint = CGPointMake(centerPoint.x+offset.width, centerPoint.y+offset.height);
CLLocationCoordinate2D destinationCoordinate = [self convertPoint:destinationPoint toCoordinateFromView:self];
MKMapPoint destMapPoint = MKMapPointForCoordinate(destinationCoordinate);
MKMapRect mapRect = self.visibleMapRect;