Skip to content

Instantly share code, notes, and snippets.

View dreampowder's full-sized avatar

Serdar Coşkun dreampowder

View GitHub Profile
@dreampowder
dreampowder / Application.java
Created August 15, 2018 11:13 — forked from engintekin/Application.java
Gzip your response in Play framework
@With(Compress.class)
public class Application extends Controller {
public static void index() {
render();//response will be gzipped
}
}
@dreampowder
dreampowder / StretchVideoView.java
Created May 12, 2018 12:42 — forked from raultm/StretchVideoView.java
Android : How to stretch video to use whole area of VideoView (sode snippets)
package com.raulete.dev.stretchvideoview.utils;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.VideoView;
public class StretchVideoView extends VideoView {
public StretchVideoView(Context context) {
super(context);
}
@dreampowder
dreampowder / NSArrayMagic.m
Created October 12, 2015 09:36 — forked from jarsen/NSArrayMagic.m
How to do lots of cool things with NSArray. Inspired by NSHipster and WWDC 2013 Session 228 - "Hidden Gems in Cocoa and Cocoa Touch"
NSArray *albums = @[[Album albumWithName:@"Random Access Memories" price:9.99f],
[Album albumWithName:@"Clarity" price:6.99f],
[Album albumWithName:@"Weekend in America" price:7.99f],
[Album albumWithName:@"Weekend in America" price:7.90f],
[Album albumWithName:@"Bangarang EP" price:2.99f]];
// Reversing an Array
__unused NSArray *reversed = albums.reverseObjectEnumerator.allObjects;
// PREDICATES