Skip to content

Instantly share code, notes, and snippets.

View pdcgomes's full-sized avatar
🏴‍☠️

Pedro Gomes pdcgomes

🏴‍☠️
View GitHub Profile
@pdcgomes
pdcgomes / gist:cb96e0e9f0705226cb19
Created January 20, 2016 14:10
Remove all device simulator for a given SDK
xcrun simctl list --json | jq '.devices | ."iOS 8.4"' | grep '.udid' | awk '{print $2}' | sed s/\"//g | xargs -I {} xcrun simctl delete {}

Update Xcode plugins to new Xcode UUID

  1. Get current Xcode UUID
XCODEUUID=`defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID`
  1. Write it into the Plug-ins's plist
@pdcgomes
pdcgomes / mergegenstrings.py
Last active August 29, 2015 14:26 — forked from yoichitgy/mergegenstrings.py
A script to generate .strings file for .swift, .m, .storyboard and .xib files by genstrings and ibtool commands, and merge them with existing translations.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Localize.py - Incremental localization on XCode projects
# João Moreno 2009
# http://joaomoreno.com/
# Modified by Steve Streeting 2010 http://www.stevestreeting.com
# Changes
# - Use .strings files encoded as UTF-8
@pdcgomes
pdcgomes / gist:8004622
Created December 17, 2013 13:08
You can use this to declare unit testing methods, they will be named: "test{index}_methodName" where {index} is automatically incremented whenever the macro is expanded. This ensures that unit tests run in the order they've been specified. WARNING: this will not work if you include the file in a precompiled header prefix
// You can use this to declare unit testing methods, they will be named:
// test{index}_methodName where {index} is automatically incremented whenever the macro is expanded
// this ensures that unit tests run in the order they've been specified
// WARNING: this will not work if you include the file in a precompiled header prefix
#define CONCAT_INNER(a, b) test##a##_##b
#define CONCAT(a, b) CONCAT_INNER(a, b)
#define DECLARE_TEST_METHOD(_testName_) CONCAT(__COUNTER__, _testName_)
async.whilst(
() =>
return taskHasCompleted is false or iterations > 0
(callback) =>
fetchEvents(msg, api_user, 1, limit,
(results) =>
filtered_data = filterFunction(results)
iterations--
callback()
@pdcgomes
pdcgomes / gist:7005463
Created October 16, 2013 10:01
Small patch to prevent naming clashes when defining message fields named 'result'
From 0510e6ed2b9dd28d141f4daa539c2a3524747e15 Mon Sep 17 00:00:00 2001
From: Pedro Gomes <[email protected]>
Date: Wed, 16 Oct 2013 10:44:12 +0100
Subject: [PATCH] [PATCH] because of potential clashes, the message builder
result holder property named 'result' has been renamed to
'__result'
---
src/compiler/objc_enum_field.cc | 34 +++++++++----------
src/compiler/objc_message.cc | 20 +++++------