Skip to content

Instantly share code, notes, and snippets.

View jlcampana's full-sized avatar
:octocat:
emu emu emu...

Jose Luis Campaña jlcampana

:octocat:
emu emu emu...
View GitHub Profile
@tempos21ios
tempos21ios / gist:5386184
Created April 15, 2013 06:48
Enums en Modern Objective-C
typedef NS_ENUM(NSUInteger, MyType)
{
MyType_XXX,
MyType_YYY,
MyType_ZZZ
};
@wolfeidau
wolfeidau / systemtap.md
Last active October 29, 2018 15:43
Configuring system tap on ubuntu 13.04, yeah so it will work.. like at all..
  • Install a base server with open ssh server enabled.
  • Update the OS.
sudo apt-get update
sudo apt-get upgrade
  • Install developement tools.
@jlcampana
jlcampana / test
Last active December 11, 2015 18:28
Test App GitHub
a ver el timestamp...
@jlcampana
jlcampana / gist:4554634
Created January 17, 2013 08:50
Eliminar celdas vacías al final de una tableview
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
//This is just for avoiding separation lines in empty rows (needs "numberOfSectionsInTableView")
if ([self numberOfSectionsInTableView:tableView] == (section+1)){
return [UIView new];
@jlcampana
jlcampana / gist:4130384
Created November 22, 2012 10:11
Lanzar búsqueda mientras escribes
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
NSString *newSearch = [textField.text stringByReplacingCharactersInRange:range withString:string];
NSLog(@"%@",newSearch);
if ([newSearch length] >= MIN_NUMBER_OF_CHARACTERS_TO_LAUCH_SEARCH)
{
//Hacer búsqueda con newSearch
}
@imrekel
imrekel / DDXMLNode+CDATA.h
Created November 21, 2012 13:31
CDATA node support for KissXML
#import <Foundation/Foundation.h>
#import "DDXMLNode.h"
@interface DDXMLNode (CDATA)
/**
Creates a new XML element with an inner CDATA block
<name><![CDATA[string]]></name>
*/
+ (id)cdataElementWithName:(NSString *)name stringValue:(NSString *)string;
@rikels
rikels / README.md
Last active February 6, 2022 23:25
chromium os plugins

this scripts installs: Flash, PDF, for some Chromium OS builds. (confirmed on Vanilla build 3389 Built on 12th December 2012!) Carputers confirmed that it also works on ArnoldTheBat's Cx86OS-20130423010101 build!

Sadly enough the Hangouts stopped working! i don't know about Netflix, since i can't test it. and since ~4-08-2013 MP3/Mp4 stopped working?

if you want to use this script on ArnoldTheBat's Chromium OS build, keep in mind that he uses the password: "password" instead of "facepunch". (without the quotes ;))

@jlcampana
jlcampana / UIBarButtonItem+Image.h
Created September 18, 2012 08:47
UIBarButtonItem+Image.h
// UIBarButtonItem+Image.h
@interface UIBarButtonItem (Image)
-(id)initWithImage:(UIImage *)image title:(NSString*)title target:(id)target action:(SEL)action;
@end
@jlcampana
jlcampana / UIBarButtonItem+Image.m
Created September 18, 2012 08:46
UIBarButtonItem+Image.m
// UIBarButtonItem+Image.m
@implementation UIBarButtonItem (Image)
-(id)initWithImage:(UIImage *)image title:(NSString*)title target:(id)target action:(SEL)action {
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame= CGRectMake(0.0, 0.0, image.size.width, image.size.height);
button.titleLabel.font = [UIFont boldSystemFontOfSize:12];
button.titleLabel.shadowOffset = CGSizeMake(0, -1);
button.titleLabel.shadowColor = [UIColor colorWithWhite:0 alpha:0.5];
@jlcampana
jlcampana / gist:3446424
Created August 24, 2012 06:14
Grados a radianes
static inline double radians (double degrees) {return degrees * M_PI/180;}