Skip to content

Instantly share code, notes, and snippets.

View fabiojgrocha's full-sized avatar

Fabio Rocha fabiojgrocha

View GitHub Profile
@wojteklu
wojteklu / clean_code.md
Last active May 1, 2024 23:47
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@slabko
slabko / gist:ce11d99bb59bcfdfd427
Last active August 16, 2018 15:04
[Cocoapods] Add preprocessor macros for pod project
platform :ios, '6.0'
pod 'ALibrary'
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
if target.name == 'Pods-ALibrary'
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'VERY_IMPORTANT_MACROS=1'
@cabeca
cabeca / simulator_populator
Created September 23, 2014 21:30
This script removes and recreates all simulators in Xcode 6.
#!/usr/bin/env ruby
device_types_output = `xcrun simctl list devicetypes`
device_types = device_types_output.scan /(.*) \((.*)\)/
runtimes_output = `xcrun simctl list runtimes`
runtimes = runtimes_output.scan /(.*) \(.*\) \((com.apple[^)]+)\)$/
devices_output = `xcrun simctl list devices`
devices = devices_output.scan /\s\s\s\s(.*) \(([^)]+)\) (.*)/