Skip to content

Instantly share code, notes, and snippets.

View reymundolopez's full-sized avatar
🏠
Working from home

Reymundo Lopez reymundolopez

🏠
Working from home
View GitHub Profile
@reymundolopez
reymundolopez / Clean_Code_notes.md
Last active July 8, 2016 19:17
My personal notes on the Clean Code Book

Clean Code

Charapter 1

The code should be something pleasant to read, something meaningful and with test cases, if is too big should be shortened, if it does too much, should be split in sub-functions/classes and should do only one thing.

No rule is written in stone, but reading good practices should give you a great place to start and make a better judgment

Charapter 2

@reymundolopez
reymundolopez / .bash_profile
Last active August 29, 2015 14:02
Install apk from Titanium using the CLI and Gennymotion
# Change the name of the app.
function __gInstall {
adb install -r build/android/bin/DEV\ MS3.apk;
}
alias genny="ti build -p android -b && __gInstall"
@reymundolopez
reymundolopez / collections.js
Last active August 29, 2015 13:56
Create a new backbone filtered collection in Titanium Alloy
var originalCollection = Alloy.Collections.myCollection;
var filtered = filterCollection();
filterCollection() {
originalCollection.fetch();
return new Alloy.createCollection("myCollection", originalCollection.filter(function(m){
return m.get("someProperty") === "someValue";
}));
@reymundolopez
reymundolopez / gist:4191987
Created December 3, 2012 01:11
Titanium - How to hide a Picker/DatePicker emulating blur (lost focus)
// To hide the picker clicking on any other section of the screen use the following code:
var win = Ti.UI.createWindow();
var view = Ti.UI.createView({
bottom : 0
});
var picker = Ti.UI.createPicker({
bottom : 0,
type:Ti.UI.PICKER_TYPE_DATE,
@reymundolopez
reymundolopez / gist:2484413
Created April 24, 2012 22:47
How to consume JSON using AFNetworking
// This is an example on how to get information using AFNetworking and
- (void) obtenerDatosDeRuta:(NSString *)ruta conMetodo:(NSString *)metodo conParametros:(NSDictionary *)parametros conBloque:(void (^)(NSArray *elementos))bloque
{
NSURL *url = [NSURL URLWithString:URL_SERVIDOR]; // TODO: Change this for your URL
AFHTTPClient *cliente = [[AFHTTPClient alloc] initWithBaseURL:url];
// If you request need parameters use 'parametros' if not just use nil
NSMutableURLRequest *request = [cliente requestWithMethod:metodo path:ruta parameters:parametros];
// This are specific values for the HTTP request, only if you need it