Skip to content

Instantly share code, notes, and snippets.

View pepicrft's full-sized avatar
🌱
Open-sourcing

Pedro Piñera Buendía pepicrft

🌱
Open-sourcing
View GitHub Profile
@pepicrft
pepicrft / clean_script
Created September 29, 2013 22:22
Delete all resources generated by "Unused.app". This app find all unused assets in your project and generates a text file with all of them. Thanks to this Python script you'll be able to clean them.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
if __name__ =='__main__':
if len(sys.argv) != 2:
print 'Filename with files to delete required as input parameter'
else:
@pepicrft
pepicrft / kvoList
Created September 30, 2013 00:19
This script analyzes all KVO observers in the project and link them with every POST in the project to those notifications. The script output is a report with all this information.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import re
#Notification Class
class Notification:
def __init__( self, observerFile, observer, notificationSelector, notificationName, notificationObject):
@pepicrft
pepicrft / py_compile
Created October 13, 2013 21:41
Generate optimized python files ( .pyo extension ) from input file given. "python py_compile.py fileToCompile.py"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Routine to "compile" a .py file to a .pyc (or .pyo) file.
This module has intimate knowledge of the format of .pyc files.
"""
import __builtin__
import imp
@pepicrft
pepicrft / update_codeversion
Created October 21, 2013 23:12
This script updates codeversion from AndroidManifest.xml file automatically. Ideal for Travis builds
# This script updates AndroidManifiest.xml file
# - Updates android:versionCode adding +1 to the version
# Reading arguments
if ARGV.length != 1
puts 'File as argument required'
exit
end
# Reading file
@pepicrft
pepicrft / NSLocalizedFinder
Last active December 26, 2015 17:39
NSLocalizedFinder finds all localized strings in your project and exports all of them into a valid .strings file
#!/usr/bin/env ruby
# This Script finds all NSLocalizedString in your project and exports them in a new file
# Detecting the number of arguments
abort("Error: #{ARGV.length} arguments passed / 2 Required") unless ARGV.length == 2
# Printing arguments
puts "Project folder: #{ARGV[0]}"
puts "Output file: #{ARGV[1]}"
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@pepicrft
pepicrft / .travis.yml
Created January 5, 2014 17:28
Android travis.yml
env:
matrix:
- ANDROID_SDKS=android-19 ANDROID_TARGET=android-19 ANDROID_ABI=armeabi
language: java
before_install:
- mvn -v
# install necessary x32-libs for Android SDK, see http://rkistner.github.io/android/2013/02/05/android-builds-on-travis-ci/
- sudo apt-get update -qq
- sudo apt-get install -qq libstdc++6:i386 lib32z1
# download the latest android sdk and unzip
attachments: parent_id, asset_id
domain_names: organisation_id
event_memberships: user_id, event_id
events: editor_id
group_actions: user_id, group_id
groups: user_id
icons: parent_id
invitations: sender_id
legacy_actions: item_upon_id
news_items: author_id
@pepicrft
pepicrft / UIView+Additions.h
Last active August 29, 2015 13:58
Extra methods and properties to UIViews
- (void)setFrameSize:(CGSize)size;
- (void)setFrameSizeWidth:(CGFloat)width;
- (void)setFrameSizeHeight:(CGFloat)height;
- (void)setFrameOrigin:(CGPoint)point;
- (void)setFrameOriginX:(CGFloat)x;
- (void)setFrameOriginY:(CGFloat)y;
- (void)centerVerticallyInParentFrame;
- (void)centerHorizontallyInParentFrame;
- (void)centerInParentFrame;
@property (nonatomic, getter=frameBottom,setter=setFrameBottom:) CGFloat frameBottom;
@pepicrft
pepicrft / Podfile
Last active August 29, 2015 13:58
Learn how to connect Redbooth API in Objective-C using Oauth2. We are going to use AFNetworking and GROAuth2SessionManager libraries to simplify the process. Learn how, and start integrating Redbooth in your apps
platform :ios, '7.0'
inhibit_all_warnings!
pod 'AFNetworking', '~> 2.2'
pod 'GROAuth2SessionManager', '~> 0.2'