Skip to content

Instantly share code, notes, and snippets.

View rbreve's full-sized avatar

Roberto Brevé rbreve

  • Finland
View GitHub Profile
@rbreve
rbreve / gist:5127070
Created March 10, 2013 04:01
merge video
if (firstAsset !=nil && secondAsset!=nil) {
[activityView startAnimating];
// 1 - Create AVMutableComposition object. This object will hold your AVMutableCompositionTrack instances.
AVMutableComposition *mixComposition = [[AVMutableComposition alloc] init];
// 2 - Video track
AVMutableCompositionTrack *firstTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo
preferredTrackID:kCMPersistentTrackID_Invalid];
[firstTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, firstAsset.duration)
ofTrack:[[firstAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] atTime:kCMTimeZero error:nil];
[firstTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, secondAsset.duration)
/*
Google HTML5 slides template
Authors: Luke Mahé (code)
Marcin Wichary (code and design)
Dominic Mazzoni (browser compatibility)
Charles Chen (ChromeVox support)
URL: http://code.google.com/p/html5slides/
- (void)updateFromJson:(NSDictionary *)json
{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd'T'HHmmssZ"];
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"_(\\w)" options:0 error:NULL];
[json enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if (obj == [NSNull null]) return;
if ([key isEqual:@"id"]) return;
NSString *_key = [key stringByReplacingOccurrencesOfString:@"class" withString:@"group"];
NSMutableString *newKey = [NSMutableString string];
1 2:00 P.M. Introducción al evento Organizadores BarCamp
1 2:15 P.M. Uso de software libre y aplicaciones de código abierto Jamileth Velásquez
1 2:45 P.M. Software libre y su aplicación en la arquitectura Hector David Hernández
1 3:15 P.M. Realidad Aumentada, aplicaciones Eduardo Irías
1 3:45 P.M. Desarrollo con JavaScript y Node.js Alejandro Morales
4:15 P.M Break / Networking Todos los participantes
1 4:45 P.M. Hacking del lenguaje corporal Reniery O'Hara
1 5:15 P.M. Herramientas para mejorar la experiencia al desarrollar aplicaciones y sitios web Cristian Garner
1 5:45 P.M. El modelo de programación GPGPU José Alejandro Matute
1 6:15 P.M. Titulo pendiente Luis Felipe Borjas
@rbreve
rbreve / gist:1219039
Created September 15, 2011 11:25
async annotations
__block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setCompletionBlock:^{
NSData *responseData = [request responseData];
//photo.thumbImage = [UIImage imageWithData:responseData];
UIImage *img = [UIImage imageWithData:responseData];
MapPoint *mp = [[MapPoint alloc] initWithCoordinate:coordinate title:@" "] ;
@rbreve
rbreve / reset.css
Created August 3, 2011 22:37
reset pictour
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
.iamstudent {
background-color: #439e52;
-khtml-border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
border-style: none;
float: right;
margin-right: 170px;
def auth_required(func):
def decorator(request, *args, **kwargs):
return basic_auth(func, request, *args, **kwargs)
return decorator
def basic_auth(func, request, *args, **kwargs):
if request.META.has_key('HTTP_AUTHORIZATION'):
(authmeth, auth) = request.META['HTTP_AUTHORIZATION'].split(' ', 1)
if authmeth.lower() == 'basic':
auth = auth.strip().decode('base64')
(r'^api/$', 'flipea.html.views.api'),
(r'^api/favorites\.(xml|json)$', 'flipea.api.views.favorites'),
(r'^api/public\.(xml|json)$', 'flipea.api.views.public_timeline'),
(r'^api/statuses/replies\.(xml|json)$', 'flipea.api.views.user_timeline_mentions'),
(r'^api/statuses/friends_timeline\.(xml|json)$', 'flipea.api.views.home_timeline'),
(r'^api/statuses/user_timeline\.(xml|json)$', 'flipea.api.views.user_timeline'),
(r'^api/statuses/user_timeline/([a-zA-Z0-9_\-]+)\.(xml|json)$', 'flipea.api.views.username_timeline'),
(r'^api/statuses/home_timeline\.(xml|json)$', 'flipea.api.views.home_timeline'),
(r'^api/statuses/public_timeline\.(xml|json)$', 'flipea.api.views.public_timeline'),
(r'^api/statuses/friends\.(xml|json)$', 'flipea.api.views.following'),
otrostring="100"
i=131312
int(otrostring+str(i)[1:len(str(i))])