Skip to content

Instantly share code, notes, and snippets.

View tomkowz's full-sized avatar

Tomasz Szulc tomkowz

View GitHub Profile
@djbriane
djbriane / GeneratePhotoThumbnail.m
Created August 3, 2009 19:43
Method that Creates a Thumbnail from a UIImage
+ (UIImage *)generatePhotoThumbnail:(UIImage *)image {
// Create a thumbnail version of the image for the event object.
CGSize size = image.size;
CGSize croppedSize;
CGFloat ratio = 64.0;
CGFloat offsetX = 0.0;
CGFloat offsetY = 0.0;
// check the size of the image, we want to make it
// a square with sides the size of the smallest dimension
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@igordeoliveirasa
igordeoliveirasa / gist:78a310f0348fcad9b270
Created March 26, 2015 01:41
iOS Loading Overlay View - SWIFT
//
// LoadingOverlay.swift
// app
//
// Created by Igor de Oliveira Sa on 25/03/15.
// Copyright (c) 2015 Igor de Oliveira Sa. All rights reserved.
//
// Usage:
//
// # Show Overlay
@Ashton-W
Ashton-W / Breakpoints_v2.xcbkptlist
Last active January 25, 2023 09:28
My User Breakpoints_v2.xcbkptlist
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "2"
version = "2.0">
<Breakpoints>
<!-- All Exceptions -->
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
@saiday
saiday / UIImage+CornerRadius.m
Created August 9, 2016 06:52
Effective corner radius
- (UIImage *)cutCircleImage {
UIGraphicsBeginImageContextWithOptions(self.size, NO, 0.0);
CGContextRef ctr = UIGraphicsGetCurrentContext();
CGRect rect = CGRectMake(0, 0, self.size.width, self.size.height);
CGContextAddEllipseInRect(ctr, rect);
CGContextClip(ctr);
[self drawInRect:rect];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;