Skip to content

Instantly share code, notes, and snippets.

View augustorsouza's full-sized avatar

Augusto Souza augustorsouza

View GitHub Profile
@augustorsouza
augustorsouza / NetworkingPlayground.swift
Created June 26, 2018 01:04 — forked from ptseng/NetworkingPlayground.swift
Code Sample for Leveraging Structs and Generics in the Networking Layer with Swift 4 (An update to objc.io Swift Talk)
import Foundation
import UIKit
import PlaygroundSupport
// MARK: HttpMethod
enum HttpMethod<Body> {
case get
case post(Body)
}
@augustorsouza
augustorsouza / using_imagemagick_convert_to_generate_half_size_images.rb
Created December 15, 2013 23:40
Sample helper script to create images generated by dragging pixelmator's layers to finder from @2x resolution to normal resolution and facilitates its use in iOS projects
# Add ...@2x.png string end to those exported using Pixelmator
Dir.glob("./*2x.png").each do |old_path|
next if old_path =~ /@2x.png/
ext = File.extname(old_path)
filename = File.basename(old_path, ext)
new_filename = filename.sub("2x", "@2x") + ext
File.rename(old_path, new_filename)
end